Concepts & Decisions
These are our decision records. Each one explains a choice we made and why. We are rewriting them so each opens in plain words anyone can follow. On a rewritten record, the full technical record is one click away, at the bottom of the page.
ADR-001: Natural Language Parsing for Location Input
Users need to input location information when creating ride requests and event requests. We needed to decide how users would specify locations (origin/destination for rides, venue for events).
ADR-002: 3-Tier Geocoding Cache Architecture
The application requires geocoding (converting addresses to GPS coordinates) for location-based features like ride requests and event planning. We needed to decide how to handle geocoding…
ADR-003: Multi-Tenant Row-Level Security (RLS) Database Design
Karmyq is a mutual aid platform where communities help each other. We needed to decide how to isolate data between different communities while maintaining performance and simplicity.
ADR-004: Microservices Event-Driven Architecture
Karmyq requires multiple services handling different concerns (authentication, communities, requests, reputation, notifications, messaging, feed, etc.). We needed to decide how these services should…
ADR-005: Minimalist Dashboard Design
The dashboard is the main entry point after login. We needed to decide what information and actions to show on the dashboard to create an effective, engaging user experience.
ADR-006: Standardized API Response Format
With 9 microservices, we needed a consistent API response format so that: - Frontend knows what to expect from every endpoint - Error handling is predictable - Debugging is easier with consistent…
ADR-007: Polymorphic Request System ("Everything App")
Users need to request different types of help: rides, services, events, borrowing items, and general assistance. We needed to decide how to model these different request types in the database and API.
ADR-008: 3-Column Dashboard Layout (V7)
V7.0 introduced a complete UI overhaul focusing on information density and social engagement.
ADR-009: Ephemeral Data Design
Mutual aid data has a natural lifecycle. Old requests, expired offers, and ancient messages lose relevance over time. We needed to decide how to handle data retention.
ADR-010: JWT-Based Multi-Community Authentication
Users need to belong to multiple communities with a single account. We needed an authentication system that supports: - Single sign-on across all communities - Different roles per community (admin…
ADR-011: Reputation Decay System (Social Karma v2)
Karma/reputation systems often suffer from: - Early adopters dominating forever - Inactive users retaining high scores - No incentive to keep helping - "Karma hoarding" behavior
ADR-012: Real-Time Communication Stack (WebSocket + SSE)
The application needs two types of real-time communication: 1. Chat/Messaging - Bidirectional, interactive conversations 2. Notifications - Unidirectional, push updates to clients
ADR-013: Monorepo with Turborepo
Karmyq has multiple applications (frontend web, mobile) and shared code (utilities, types, schemas). We needed to decide how to organize the codebase.
ADR-014: Testing Strategy (Integration + E2E + Unit)
With 9 microservices, 2 frontends, and complex data flows, we needed a comprehensive testing strategy that catches bugs at the right level without duplicating effort.
ADR-015: Observability Stack (Grafana/Loki/Prometheus)
With 9 distributed microservices, we needed: - Centralized logging (debug across services) - Metrics collection (performance monitoring) - Visualization (dashboards) - Alerting (production issues)
ADR-016: Prestige-Based Recognition System
Traditional karma/reputation systems often create extractive dynamics (accumulation-focused) rather than generative ones (contribution-focused). We need a recognition system that: - Rewards ongoing…
ADR-017: Cohort-Based Community Layers
We decided to sort the members of a community into three layers, based on how often they take part. The inner circle is 5 to 7 people who interact weekly or more. The active community is about 15 to…
ADR-018: Community Splitting Mechanics
We decided that a community should split into smaller ones before it grows too big, at around 130 to 140 members. The record gives its reason. A community of more than about 150 people loses trust…
ADR-019: Referral Chain Trust System
Open community platforms face the "bad actor" problem. Traditional solutions: - Centralized KYC/identity verification (privacy invasive, excludes marginalized) - Algorithmic risk scoring (black box…
ADR-020: Trust-First Design Philosophy
Platform design philosophy falls on a spectrum:
ADR-021: Configurable Trust Path Filtering & Adaptive Trust Preferences
Karmyq's core value proposition is trust-based mutual aid through social graphs. As communities grow, users need control over how far out in their trust network they see requests and offers. Without…
ADR-022: Multi-Tier Feed Architecture (Explore-Exploit Balance)
Karmyq faces a fundamental tension between community cohesion (exploit) and platform growth (explore). Our current implementation (ADR-003) enforces strict community boundaries via Row-Level…
ADR-023: Infrastructure Standardization and Environment Management
During deployment of the simulation service to production (January 2026), we encountered several critical issues stemming from inconsistent infrastructure configuration across environments:
ADR-024: Synthetic User Simulation for Demo Environment
Currently, production seeding creates static demo data (2000 users, 200 communities, historical requests/matches). While this provides initial data, it lacks the dynamic, living quality of a real…
ADR-027: Docker Image Size Optimization (Deferred Technical Debt)
During implementation of the self-hosted Docker registry (ADR-026), we discovered that our Docker images are significantly larger than optimal:
ADR-028: NPM Workspace Package for Shared Code in Docker
Services were failing at runtime with "Cannot use import statement outside a module" errors when importing from @karmyq/shared. Investigation revealed multiple issues with how the shared package was…
ADR-029: Test-Driven Development (TDD) Framework
The project had issues with testing and CI/CD: - Tests were frequently skipped due to failures - No clear separation between unit tests, integration tests, and work-in-progress tests - Integration…
ADR-030: Community Configuration System (Phase 1)
Karmyq communities are "digital villages" (max 150 members) that coordinate non-monetary exchanges. Different communities have different values, trust models, and coordination patterns. We need a…
ADR-031: Unified Trust-Scored Feed & Community Specialization
Karmyq v9.0 shipped a polymorphic request system, curated feed with match scoring, community configuration, and trust path computation. These subsystems work individually but are not connected — the…
ADR-032: Server-Driven UI - Database-Driven Request Type Schemas
Currently, adding a new request type (e.g., "dog walking", "tutoring") requires: 1. Backend Zod schema changes (code) 2. UI schema changes (code) 3. Frontend form changes (Next.js) 4. Mobile app…
ADR-033: Offer Fulfillment Workflow
Karmyq's current match lifecycle ends at matched status — both parties know a match was accepted, but there is no structured guidance for what happens next. For time-sensitive requests (rides, tool…
ADR-034: Multi-Layer Trust Path Computation
When a user sees a request in the feed, we want to show them how they're connected to the requester. The challenge: not all users have completed exchanges yet. New members, recently joined…
ADR-035: Karma Allocation Strategy and Trust Score Abstraction
The reputation system had two related problems:
ADR-036: Private Feedback Model — Trust Without Rating Economies
After implementing the trust score formula (50 + karma_contribution + feedback_contribution), we needed a mechanism for users to submit quality feedback after a completed interaction. The…
ADR-037: Multi-Signal Trust Score — Bonding Capital, Bridging Capital, and Community-Configurable Floors
Three clarifications to how this model is fed. The formula itself is unchanged.
ADR-038: Cross-Community Trust — Carry Model with Community-Configurable Decay
Trust scores in Karmyq are computed per-community. A user joining a new community starts with a score of 0 and must earn trust from scratch. This creates two problems:
ADR-039: Trust Score Decay Consistency — Time-Weighted Signals
ADR-011 established a 6-month half-life exponential decay on karma points, correctly recognizing that old activity should matter less over time. getUserKarmaWithDecay() implements this.
ADR-040: Community Trust Score
Karmyq computes trust scores for individual users (ADR-037), but communities themselves have no trust signal. A user considering whether to post a request in a new community — or whether to trust an…
ADR-041: Two-Layer Mutual Aid + Professional Services
Karmyq is a mutual aid platform built on a gift economy: karma, reciprocity, community scoping. But real neighborhoods also contain people who do provide services for pay — rickshaw operators…
ADR-042: Provider Trust Score
Layer 2 providers (ADR-041) need a trust signal that is: - Visible to anyone considering hiring the provider - Based on direct service experience, not community relationships - Separate from ADR-037…
ADR-043: Three-Score Model — Karma, Personal Trust, and Provider Trust
Karmyq users accumulate three distinct reputation signals as they participate on the platform:
ADR-044: Community Trust Model Questionnaire
Community configuration has 17+ abstract numeric fields (trust_depth_weight: 0.6, karma_split_helper: 80, karma_decay_half_life_days: 90, etc.). Founders found these numbers difficult to reason…
ADR-045: Network Cohesion Score
ADR-040 introduced a Community Trust Score measuring member quality and bonding/bridging social capital rates. That model captures who the members are and whether help gets completed, but it does…
ADR-046: Trust Model Evolution
Trust parameters (depth/breadth weights, carry factor, decay) are currently configured once at community setup and remain static. This means users with consistently positive cross-community…
ADR-047: Community Evolution Engine
Sprint 30 introduced individual trust evolution — each user's trust parameters calibrate based on lived experience. This creates a source of signal that had no destination: individual calibrations…
ADR-048: Feed Ranking v2 — 7-Signal Formula + Interaction Logging
Sprint 43 extends ADR-031's 4-signal feed scoring with 3 additional signals: requester trust score, prior interaction history, and request recency. It also introduces a requests.feed_events table to…
ADR-049: Error Visibility — `error_type` Discriminator and `X-Request-Id` Convention
All 11 services emit structured JSON logs via the shared logger. Grafana/Loki is deployed (ADR-015) but no dashboard existed specifically for error diagnosis. Operators had no way to distinguish…
ADR-050: Group Communities as a Distinct Community Type
Karmyq communities have historically been uniform: all are mutual aid networks coordinating help requests. As the platform grows, users want to coordinate recurring shared activities — sports…
ADR-051: Explore/Exploit Two-Tier Dibs Candidate Selection
The dibs candidate selection system (filterEligibleCandidates in dibsScoringService.ts) previously required priorInteractions >= 1 as a hard gate. This is pure exploitation — it only considers…
ADR-052: Security Hardening — OWASP Top 10 Baseline
No security audit had been performed on Karmyq prior to Sprint 54. An OWASP Top 10 review identified vulnerabilities across six categories: SQL injection, broken access control, CORS…
ADR-053: Feed Design Philosophy
Karmyq has two types of feeds: the community Browse feed (where members find open requests) and the dashboard Active tab (where members track their commitments). Both need design principles grounded…
ADR-054: Trust Graph Architecture
We decided that Karmyq should measure trust between two specific people, not just count how much good a person has done overall. Karma is a score you earn when someone marks your help as complete…
ADR-055: Trust-Based Governance Architecture
The maintainer selected equal votes over trust-qualified or trust-weighted ratification. New nominations use max(3, ceil(E / 5)), where E is the active membership excluding the nominee at creation…
ADR-056: Intrinsic Trust Decay (Interaction Half-Life)
Trust edges in Karmyq encode the strength of the relationship between two members. Prior to this ADR, raw_weight was a static snapshot — a cumulative score that never changed after being set. This…
ADR-057: Community Fission Mechanism
Communities following Dunbar's Number (~150 members) become dysfunctional as they grow. Social cohesion degrades, trust becomes diluted across too many relationships, and the mutual-aid promise…
ADR-058: Fusion Mechanism
Fission (ADR-057) allows a community to split into two. Fusion is the symmetric inverse — two communities voluntarily merge into one. Both mechanisms complete the community lifecycle toolkit in the…
ADR-059: Dependency Vulnerability Remediation + Blocking CI Security Gate
A routine audit surfaced 31 npm audit vulnerabilities (6 high, 25 moderate) across the single root package-lock.json (npm workspaces; no separate mobile lockfile), corresponding to ~13–25 open…
ADR-060: Code Scanning Remediation + Blocking CI Code-Scanning Gate
ADR-059 closed the dependency half of our security posture with a blocking npm audit gate. The code half — CodeQL static analysis — was running but advisory only: alerts accumulated on the Security…
ADR-061: Supply-Chain & Secrets Hardening
ADR-059 (dependency audit gate) and ADR-060 (code-scanning gate) close the known-vulnerability and static-analysis gaps. Neither addresses the supply-chain ingestion vector: the path by which a…
ADR-062: Community Identity & Idempotent Creation
The demo database accumulated 707 communities across only ~23 distinct names (697 duplicates; "PDX Service Providers Network" appeared 78 times). 3,047 memberships and 1,410 request-links were…
ADR-063: Canonical Decayed Trust Metric & Unified Graph Visualization
We decided two things about how Karmyq shows trust between people.
ADR-064: Authorize Mutations from Authenticated Identity, Not Client-Supplied IDs
A mutation's authorization decision must answer "is this actor allowed to do this?" The actor is whoever the verified JWT says it is — req.user.userId, populated by authMiddleware after signature +…
ADR-065: Karmyq.org and Karmyq.com Domain Roles
We decided that our two websites do two different jobs. karmyq.org is the public home. It holds the manifesto, research, stories, documents and the invitation to the founding circle. karmyq.com is…
ADR-066: Unified Feed Model
Karmyq's feed surfaces grew by accretion: three overlapping implementations of "a list of requests a member can act on" (BrowseFeed, community BrowseTab, the unmounted Feed/Feed.tsx), each with its…
ADR-067: `request_type` vs `payload_type` Vocabulary
ADR-066 shipped the unified feed but left one modelling seam documented and untouched: RequestCardData.request_type was typed as the fine payload-subtype union (transportation | moving_help |…
ADR-068: Community Page Information Architecture (warm four-tab model)
Sprint 88 shipped the warm "warm-commons" shell and reskinned the feed surface — the relationship-led RequestCard, the .kq-* shell, TrustPathBadge, finite "caught up" states. But the community page…
ADR-069: Data Retention and Forgetting (content anonymization policy)
Karmyq's manifesto (§7) and ADR-066 promise a platform that is "designed to forget." As of Sprint 89 that promise was real only at the edge layer — trustEdgeSweepJob deletes decayed trust edges…
ADR-070: Visible Decay Model (decay tiers + re-warming nudge)
The trust graph already decays: trust_edges_live.current_weight falls exponentially ([ADR-056], Sprint 68 half-life), and trustEdgeSweepJob deletes an edge once its decayed weight drops below the…
ADR-071: Fold Feed Service Into Request Service
Karmyq entered Sprint 91 with 11 backend services. feed-service was a pure read/view layer: it owned no Bull queues, cron jobs, event subscribers, or durable write workflow. Its live behavior…
ADR-072: Dibs Scope — the Neighbor/Provider First-Ask Seam
"Dibs" (ADR-051) lets a requester privately give one trusted person first right of refusal before a request goes public. It was designed in the service-provider layer (ADR-041's two-layer model)…
ADR-073: Provider↔Community Link-Up
Members reported the community / service-provider relationship "seems confusing" (IDEAS 2026-06-08). A Sprint 93 audit-first investigation (Playwright walkthrough of the live demo + code review —…
ADR-074: Canonical Error Response Contract
Karmyq's root API contract specifies errors as a string code plus a human-readable message:
ADR-075: karmyq.org Multi-Route Relaunch
We decided to split the karmyq.org website into five pages, each with one job. Before, everything sat on one long page. The story, the principles, how it works, the research and the invitation all…
ADR-076: Founding-Circle Backend Intake
We decided to save join requests from karmyq.org in a list we own. Until now, the join form opened the visitor's own email program. A note only reached us if that program worked and the visitor…
ADR-077: Trust Path Topology is Platform-Wide; Strength is Community-Scoped
Karmyq shows relationship "trust paths" on many surfaces (feed request cards, provider pages, trust cards, dibs prompts). The Sprint 98 trust-truth audit asked a question the code had never answered…
ADR-078: Community Connection Reconciliation from `request_communities`
The community pulse counts completed exchanges ("N neighbours helped each other this week"), and the "How we're connected" surface draws relationships from social_graph.trust_edges. These two should…
ADR-079: Karmyq Visual Design System v2 (finish the warm system + harden it into tokens)
Sprint 88 shipped a "warm commons" design system — the .kq-* shell (karmyq-shell.css), Fraunces + Hanken Grotesk type, relationship-led RequestCard, finite "caught up" states, one quiet…
ADR-080: Retain Geocoding Cache as External API Policy Boundary
ADR-071 listed geocoding-service as a candidate for removal after feed-service was folded into request-service. During Sprint 109 planning, we rechecked the public Nominatim usage policy. Karmyq's…
ADR-081: Belonging Graph System — One Engine, One Language, One Explorer
We decided that every picture of how people belong to Karmyq should work the same way. Before, the app had six network pictures. They used different drawing styles and different code. Three unused…
ADR-082: Reputation Disclosure Boundary
We decided that your exact reputation numbers are yours alone. Reputation numbers stay private: no other member can see them, and neither can an administrator. Karmyq may show how people and…
ADR-083: Contextual Belonging Graph Rendering (Earned Structure)
We decided that the pictures of how people are connected should show only what we actually know. They should not invent patterns.
ADR-084: Context-Bound Connection Visibility
Karmyq asks people to help someone they may not know directly. A generic network explorer explains a member's own surroundings, but it does not answer the decision-time question: how are this…
ADR-085: Invited Arrival & the Edge Lifecycle
Three related gaps kept the belonging graph from telling a member's story end-to-end:
ADR-086: Scale Answers — One Question per Zoom Level
Sprint 114 removed a graph presentation that inferred groups and visual hierarchy the disclosed topology did not contain. ADR-083 replaced it with deterministic, earned structure, and ADR-085 gave…
ADR-087: One Seed Path — init.sql Regeneration
Karmyq currently has two ways to construct a database: load infrastructure/postgres/init.sql, or apply the ordered migration chain. The snapshot has been maintained separately from the migrations…
ADR-088: Test-Tier Truthfulness
This record is for contributors who write, run or review Karmyq's automated tests.
ADR-089: ts-jest Cannot Read `exports` Maps — `typesVersions` Is the Contract
@karmyq/shared publishes its public surface through an exports map with subpaths (@karmyq/shared/matching/types, @karmyq/shared/schemas/ui, and 17 more). Node's runtime resolver reads exports…
ADR-090: The Container Runtime Floor Is Node 24, and It Is Enforced
Dependabot #169 proposed redis (node-redis) 4.7.1 → 6.2.0. node-redis 6 declares engines.node: ">= 20.0.0". Every backend Dockerfile built and ran on node:18-alpine, and root package.json declared…
ADR-091: Verification Before Assertion — the Sprint 122 review-loop retrospective
At the end of Sprint 122's PR 4, the maintainer flagged that the correction cycles were too expensive and asked for the review loop to be examined once the sprint closed, with data rather than…
ADR-092: AGPL-3.0-or-later, and the Manifesto Audit That Produced It
Karmyq's public manifesto at karmyq.org makes a specific promise: "Every line of code is public. Fork it, improve it, make it yours. The infrastructure for cooperation should belong to everyone —…
ADR-093: The `federation` Schema Is Reserved, Not Live
CLAUDE.md told every agent the database has 13 schemas. It has twelve live ones and one fossil.
ADR-094: Generalized Exemption Registries
A gate that has no honest way to record a reviewed exception eventually becomes noise. The dependency-audit gate first exposed this problem when a high-severity image-size advisory had no published…
ADR-095: Authenticated Provider Directory and Reach-Gated Standing
Migration 022-provider-profiles.sql added three columns to communities.community_configs:
ADR-096: Canonical Completed-Match Standing Projection
Personal standing is a projection of completed exchanges. Three separate code paths claimed to perform that projection, and all three disagreed.
ADR-097: Ecosystem Knowledge Registry
Code in this repository has a mechanism for staying true: it evolves through commits, it is reviewed, and tests fail when it rots. Operational knowledge has none. Facts like "git hooks install to…
ADR-098: Trusted Proxy Hop and Rate Limit Key Derivation
packages/shared/middleware/rateLimit.ts is the one rate limiter every HTTP service uses. Its keyGenerator returned user:<userId> for authenticated requests and undefined for everyone else, with a…
ADR-099: Inventories and Directed Requests
Members need to describe both skills they offer and things they can share. Before PR A, the profile's fixed skill picker and free-text tags were separate stores, and matching read only the picker…
ADR-100: Skill Visibility and Endorsements
Sprint 132 established skill tags as the single skill store. Caller-owned profile tags serve the editor and feed matching; members also need to find someone with a skill in their community. A…
ADR-101: Per-Consumer Event Queues
Before this decision, every service published to one Bull queue, karmyq-events, and three services (notification, reputation, social-graph) attached workers to it. Each worker registered only the…
ADR-102: Authorization Re-derives the Role from Live Membership
ADR-010 put the caller's communities and roles in the JWT (communities: [{ id, name, role }]) so a gate could authorize "with no database lookup per request". The claim is written at login and…
ADR-103: Listings Trust the Authenticated Caller, "All" Is an Explicit Status, and a Security Fix Must Not Switch On Dormant Simulation
Sprint 140 PR A changes three services at once, which CLAUDE.md says needs an ADR.
ADR-104: Agent Process Economy — Mechanical Checks Are Scripts, Judgment Runs Once per PR, and Context and Model Fit the Task
Most of this repository's changes are written and reviewed by coding agents, so the cost of the process is mostly the cost of agent sessions. Three costs were paid repeatedly without buying any…
ADR-105: Platform Admin Is a Granted Role, Separate from Community Admin
We decided that running a community does not make you an administrator of the whole platform. There are now two separate roles. A community admin looks after one community: its members, its settings…
ADR-106: Database-Owned Community Member Count
communities.communities.current_members is a cache of the number of active communities.members rows. People see it: the community hero shows "N neighbours · room for M more" and disables Join when…
ADR-107: Plain-Language Decision Records
From now on, every decision record we write opens with a short section in plain words. It says what we decided, why it matters to people, what it means for you, and whether the decision still holds…