Before generating code, find relevant ADRs by keyword and read them.

By topic

Go / code quality

  • ADR-0001: golangci-lint quality gate → linting, errcheck, gocritic, staticcheck, ci, go

Database / persistence

  • ADR-0002: PostgreSQL AFTER triggers for audit trails → audit, compliance, triggers, leave, postgresql, jsonb
  • ADR-0007: Two complementary audit systems → audit, audit_trail, audit_log, compliance, triggers, leave

Messaging / events

  • ADR-0003: Transactional outbox pattern → outbox, nats, events, reliability, distributed-systems

Architecture / modules

  • ADR-0004: Shared kernel + Anti-Corruption Layer for inter-module lookup → modules, decoupling, ddd, bounded-context, microservice, acl
  • ADR-0009: ACL per module for bounded context isolation → ddd, bounded-context, acl, microservice, modules
  • ADR-0052: Cross-stack contracts guarded by drift tests, not codegen → architecture, cross-stack, contracts, testing, drift, codegen, seam, ci
  • ADR-0054: Standalone quiz app owns its authentication and database → quiz, astro, architecture, better-auth, postgresql, product-boundary
  • ADR-0055: Rental module shares the platform Postgres database and Better Auth → rental, architecture, better-auth, postgresql, multi-tenancy, product-boundary, adr-0006, adr-0054
  • ADR-0056: Public rental marketplace is a standalone Astro app on rent.gremlin.my that reads Go directly (anonymous public reads bypass Bun) → rental, astro, architecture, product-boundary, seo, cloudflare, caching
  • ADR-0057: Rental listing slugs are immutable — generated once on first live, always suffixed, composed from structured fields → rental, seo, slug, url, data-model, product-boundary
  • ADR-0058: Tenancy agreement PDFs are frozen at issue, content-addressed and byte-deterministic, not rendered on demand → rental, legal, pdf, immutability, audit-trail, data-model, storage
  • ADR-0059: Click-to-sign under the Electronic Commerce Act 2006 — no PKI, no third-party e-sign provider → rental, legal, e-signature, security, evidence, pdpa, product-boundary
  • ADR-0060: One lawyer-reviewed tenancy template — the platform fills blanks and never drafts (Legal Profession Act 1976 s.37) → rental, legal, compliance, product-boundary, template, pdf
  • ADR-0061: Product-scoped platform AI for B2C rental — the Access Gate gains a product_key scope beside organization_id, with per-scope partial unique indexes on ai_usage → rental, ai, access-gate, usage-accounting, multi-tenancy, schema, b2c, product-boundary
  • ADR-0062: One Rental-wide rental_notification_events table with a polymorphic (subject_type, subject_id) anchor and no parent foreign key — one claim-and-retry worker for every slice → rental, notifications, email, retry, idempotency, data-model, schema, foreign-keys, duplication, adr-0055, adr-0021
  • ADR-0063: The rental landlord/tenant portal is a standalone SolidStart app on its own deployment; panel keeps only /admin/rental/listings, no shared rental package, /owner/* renamed /landlord/* → rental, solidstart, architecture, product-boundary, deployment, cloudflare, better-auth, naming, adr-0054, adr-0055, adr-0056
  • ADR-0064: Jev listing check sends the full property address to TypeSafe, with Gremlin owning disclosure and vendor-term verification before real-data use → rental, ai, typesafe, privacy, address, third-party, retention, disclosure
  • ADR-0065: A photo gallery sync owns only its own Source’s photos; ownership by source, not origin_channel; unowned photos never move or get removed by sync; owned photos read-only in the panel → rental, landlord-api, sync, photos, ownership, source, contract
  • ADR-0066: Jev chat message check sends raw chat text to TypeSafe; masking deferred; separate TYPESAFE_RENTAL_CHAT_ENABLED gated on Gremlin disclosure → rental, ai, typesafe, privacy, chat, third-party, retention, disclosure
  • ADR-0067: Jev duplicate check sends address fields of a property and up to 10 other-landlord candidates to TypeSafe, incl. a one-time backfill; separate TYPESAFE_RENTAL_DUPLICATE_ENABLED gated on Gremlin disclosure → rental, ai, typesafe, privacy, address, duplicate, third-party, retention, disclosure
  • ADR-0068: production decision-model calls replayed against a local Kev on a developer machine; SELECT-only with normal login, output holds ids and probabilities only; gated on Gremlin confirmation → rental, ai, typesafe, kev, privacy, replay, calibration
  • ADR-0069: Shared packages/ui components take the rental look from RentalThemeBoundary (no opt-in prop); overridable rental styling is Tailwind merged by cn(); rental uses only --rental-* variables; a guard test blocks glass and raw palette classes → rental, solidstart, ui, design-system, theming, css, tailwind, glass, adr-0063
  • ADR-0070: One shared uploads module (/api/v1/uploads) for every app; the app decides user vs org owner; private by default, public for images only; bytes decide the type and script-capable files are refused; limits only tighten; chunked uploads via S3 multipart; upload-then-claim with a 24h sweep; replaces fieldforce attachments later (#153) → uploads, storage, seaweedfs, s3, multipart, security, xss, rental, fieldforce, digital-worker, go, attachments
  • ADR-0071: Jev payee check sends the landlord’s pay-to account name and the receipt payee name to TypeSafe, unredacted; separate TYPESAFE_RENTAL_PAYEE_ENABLED gated on Gremlin disclosure confirmation and threshold calibration via replay → rental, ai, typesafe, privacy, payee, payments, names, threshold
  • ADR-0072: Partner-created landlords are claimed only through platform email (partner never sees the claim secret; one serialized claim path; emailVerified only on claim); a partner recovers only the account its own attempt stamped, every other existing account needs consent; no submit before the claim → rental, partner-api, better-auth, identity, consent, claim, email, security, contract
  • ADR-0073: API hosts (bun-api.*, go-api.*) are DNS-only in Cloudflare; the app and Better Auth rate limiters both key on spoof-proof Fly-Client-IP (not CF-Connecting-IP / leftmost X-Forwarded-For) → infra, cloudflare, fly, dns, rate-limit, better-auth, security, client-ip
  • ADR-0074: One Redis on the home NAS for Fly and K8s (rate limits, idempotency, revocation markers); K8s on the LAN at 192.168.0.142:6380, Fly over the WireGuard peer gremlin-nas-redis on 6PN; NAS outage = memory fallback, revocation fails open, partner key routes 503 until Redis is back (no restart needed) → infra, redis, fly, wireguard, k8s, nas, rate-limit, revocation

Authentication / authorization

  • ADR-0005: Stateless JWT with direct PostgreSQL reads → authentication, jwt, better-auth, postgresql, redis, security
  • ADR-0006: Go backend as read-only Better Auth consumer → authentication, better-auth, postgresql, multi-tenancy, permissions
  • ADR-0053: Better Auth owns users in Bun — no users hexagon (deliberate exception to Hexagonal/DDD) → authentication, better-auth, bun, architecture, hexagonal, ddd, users, dead-code
  • ADR-0055: Rental shares platform database and Better Auth; landlord is a distinct global role token from org-scoped owner → authentication, better-auth, rental, roles, multi-tenancy

HTTP / API

  • ADR-0008: Automatic validation middleware → http, echo, validation, middleware, handlers

CLI / developer tooling

  • ADR-0010: grm CLI uses OAuth 2.0 Device Flow with API key storage → cli, grm, oauth2, device-flow, api-key, authentication
  • ADR-0011: Better Auth bearer plugin required for CLI API key creation → cli, grm, better-auth, bearer, api-key, authentication
  • ADR-0012: Per-device API key naming and revocation → cli, grm, api-key, hostname, revocation, multi-device

Database / conventions

  • ADR-0021: Table naming — module-owned vs cross-cutting registries → database, naming, conventions, ddd, modules

Fieldforce / task management

  • ADR-0013: Event-based API for task status transitions → fieldforce, state-machine, api, patch, events, transitions
  • ADR-0014: Generic state machine in shared kernel → fieldforce, state-machine, shared-kernel, ddd, reuse
  • ADR-0015: Append-only review_notes JSONB array for rejection history → fieldforce, jsonb, audit, history, immutability
  • ADR-0016: Two-tier feature flags — global kill-switch + per-org toggle → fieldforce, feature-flags, multi-tenancy, admin
  • ADR-0017: Supervisor team scope resolved by scanning shared member table → fieldforce, teams, supervisor, better-auth, adr-0006
  • ADR-0018: Frontend server action handles SeaweedFS upload, Go persists metadata only → fieldforce, s3, seaweedfs, upload, attachments
  • ADR-0019: Unified org_module_configs table for per-org module configuration → fieldforce, org-config, jsonb, multi-tenancy, modules
  • ADR-0020: Overdue escalation is notify-only, no auto-reassignment → fieldforce, overdue, escalation, notifications
  • ADR-0022: Daily fieldforce briefings as stored snapshots → fieldforce, briefing, snapshot, cron, ai, idempotency
  • ADR-0023: Lease-then-LLM ordering for cron-driven AI generation → cron, ai, idempotency, multi-replica, fieldforce, briefing
  • ADR-0024: Per-org local-time scheduling via Go-side time.LoadLocation → cron, scheduling, timezones, fieldforce, briefing
  • ADR-0025: DB-managed LLM prompts as canonical, no code fallback → ai, prompts, llm, fieldforce, briefing

Docs / spec review tooling

  • ADR-0026: LLM-driven HTML enrichment with agent file-writing contract → ai, llm, docs, astro, plans, generation, agentic-cli
  • ADR-0027: Closed component vocabulary for plans-app spec review pages → docs, astro, plans, design-system, llm, ai, generation

Digital Worker / chat agents

  • ADR-0028: Two-tier LLM — local triage as an unbilled pre-gate filter → ai, llm, digital-worker, ollama, triage, access-gate, cost
  • ADR-0029: Worker acts on external chat without per-action approval (safe-executable vs consequential) → digital-worker, security, approval, capability-policy, chat
  • ADR-0030: Extraction watermark — advance-on-success, divergent outage recovery (flag-off skips, cap-exhaustion backfills) → digital-worker, dedup, watermark, privacy, cost
  • ADR-0031: Direct messenger integration (no middleware); Discord Gateway single-owner lease → digital-worker, integration, telegram, discord, whatsapp, multi-replica, lease
  • ADR-0032: Role-agent-owned, cross-channel memory with policy precedence → digital-worker, memory, learning, multi-tenancy, ddd, precedence
  • ADR-0033: Verified-identity-gated auto-save for role-agent memory → digital-worker, memory, learning, security, prompt-injection, identity
  • ADR-0034: Non-destructive memory budgeting — inject-time cap, no LLM compaction → digital-worker, memory, learning, cost, prompt-assembly
  • ADR-0035: Self-service DM-code identity verification; webhook external_user_id is the authoritative binding key → digital-worker, identity, verification, onboarding, telegram, whatsapp, security
  • ADR-0036: Verification resolves pre-identity with atomic single-use code consumption; generic no-oracle failures; extends ADR-0029 safe-set → digital-worker, identity, verification, atomicity, rate-limiting, security
  • ADR-0050: Local embeddings for semantic history search (unbilled, search-only, async); per-domain model-scoped embedding tables → digital-worker, memory, learning, ai, search, embeddings, pgvector, cost, multilingual

Fieldforce mobile / Flutter client

  • ADR-0037: Flutter for the mobile client (over React Native, Capacitor, native) → fieldforce, digital-worker, mobile, flutter, platform, vibe-coding, offline-first
  • ADR-0038: melos monorepo with multi-app + shared core_* packages, structured from day one → fieldforce, digital-worker, mobile, flutter, monorepo, melos, modules, ddd
  • ADR-0039: Clean Architecture with an inward-pointing package dependency DAG → fieldforce, digital-worker, mobile, flutter, architecture, clean-architecture, hexagonal, ddd, dependency-rule
  • ADR-0040: FieldForce offline + realtime sync — adopt PowerSync over a hand-built sync engine → fieldforce, mobile, flutter, offline-first, realtime, sync, powersync, postgres, idempotency
  • ADR-0041: Mobile auth — Go-minted JWT with refresh-on-401, offline grace, verified-identity gate → fieldforce, digital-worker, mobile, flutter, authentication, jwt, security, offline, verified-identity, better-auth
  • ADR-0042: Riverpod for dependency injection and state management → fieldforce, digital-worker, mobile, flutter, state-management, dependency-injection, riverpod, codegen
  • ADR-0043: FieldForce background location — flutter_background_geolocation, three-gate activation, telemetry routed around PowerSync → fieldforce, mobile, flutter, location, background-execution, feature-flags, privacy, consent, telemetry
  • ADR-0044: Push notifications — FCM + APNs with sync-on-push and deep-link routing → fieldforce, digital-worker, mobile, flutter, notifications, fcm, apns, deep-link, background-execution, powersync
  • ADR-0045: Error modeling — sealed Result<T> + AppFailure over Either/exceptions → fieldforce, digital-worker, mobile, flutter, error-handling, result, sealed-class, dart, type-safety
  • ADR-0046: Internationalization — slang over official gen-l10n → fieldforce, digital-worker, mobile, flutter, i18n, localization, slang, codegen
  • ADR-0047: Mobile CI/CD on Codemagic (backend stays on GitHub Actions) → fieldforce, digital-worker, mobile, flutter, ci-cd, codemagic, github-actions, code-signing, monorepo
  • ADR-0048: Mobile version skew — server-driven minimum-version gate + backward-compatible API window → fieldforce, digital-worker, mobile, flutter, versioning, compatibility, forced-upgrade, api, release, powersync
  • ADR-0049: Device data lifecycle — per-user local database, lock-vs-wipe policy, encryption at rest → fieldforce, digital-worker, mobile, flutter, security, privacy, powersync, sqlite, sqlcipher, offboarding, offline