Grand Diomande Research · Full HTML Reader

System Glossary: Milk Men

**Document ID:** GLOSSARY-001 **Version:** 1.0.0-DRAFT **Created:** 2025-12-26 **Governing Document:** 0.1.1-PROJECT-CHARTER.md **Purpose:** Define all core terms to eliminate ambiguity in implementation

Agents That Account for Themselves research note experiment writeup candidate score 26 .md

Full Public Reader

System Glossary: Milk Men

Document ID: GLOSSARY-001
Version: 1.0.0-DRAFT
Created: 2025-12-26
Governing Document: 0.1.1-PROJECT-CHARTER.md
Purpose: Define all core terms to eliminate ambiguity in implementation

---

Usage Rules

1. No term may be used in code, documentation, or discussion unless defined here
2. Terms are case-sensitive in code; case-insensitive in discussion
3. If a term appears ambiguous, this document is authoritative
4. New terms require glossary update before use

---

1. Domain Layer Terms

These terms describe business concepts independent of implementation.

1.1 Organization

AttributeValue
DefinitionA distinct business entity that uses the platform; the top-level tenant boundary
What it isA company, team, or business unit with its own members, data, and configuration
What it is NOTA user account; a region; a team within an organization
LayerDomain / Conceptual
Database Table`organizations`
Swift Type`Organization`
CardinalityOne user belongs to exactly one organization

1.2 Vertical

AttributeValue
DefinitionAn industry category that determines default terminology and feature configuration
What it isA preset configuration template (Coffee & Beverage, Food Service, Retail & Wholesale, Custom)
What it is NOTA separate product; a customizable workflow engine; a user-defined category
LayerDomain / Configuration
Database Column`organizations.vertical_id`
Swift Type`VerticalType` (enum)
Values`coffee_beverage`, `food_service`, `retail_wholesale`, `custom`

1.3 Member

AttributeValue
DefinitionA user who belongs to an organization with an assigned role
What it isThe association between a user account and an organization
What it is NOTThe user account itself; an agent record; an invite
LayerDomain / Access Control
Database Table`organization_members`
Swift Type`OrganizationMember`

1.4 Location

AttributeValue
DefinitionA physical business establishment that is a current or potential customer
What it isA shop, restaurant, store, or account with geographic coordinates
What it is NOTA user's location; a GPS coordinate without business context; a territory
LayerDomain / Core Entity
Database Table`locations`
Swift Type`Location`
Terminology VariantsShop (Coffee), Restaurant (Food), Account (Retail), Location (Custom)

1.5 Agent

AttributeValue
DefinitionA field representative who executes routes, visits locations, and records activities
What it isA sales rep, delivery driver, or field service person with assigned work
What it is NOTA user account (though linked); a software agent; an AI agent
LayerDomain / Core Entity
Database Table`agents`
Swift Type`Agent`
Terminology VariantsAgent (Coffee), Driver (Food), Rep (Retail), Agent (Custom)

1.6 Visit

AttributeValue
DefinitionA recorded interaction between an agent and a location
What it isA time-bounded activity at a specific location with logged outcomes
What it is NOTA route stop (planned); a location view (passive); a delivery (transaction)
LayerDomain / Core Entity
Database Table`store_visits`
Swift Type`StoreVisit`
Terminology VariantsVisit (Coffee), Service Call (Food), Sales Call (Retail), Visit (Custom)

1.7 Route

AttributeValue
DefinitionAn ordered sequence of locations to be visited by an agent
What it isA planned itinerary with optimized stop order and navigation
What it is NOTA territory (boundary); a visit log (historical); a delivery schedule
LayerDomain / Core Entity
Database Table`routes`
Swift Type`Route`

1.8 Territory

AttributeValue
DefinitionA geographic boundary defining an agent's assigned coverage area
What it isA polygon on a map with an assigned agent
What it is NOTA region (administrative); a route (itinerary); a list of locations
LayerDomain / Geographic
Database Table`territories`
Swift Type`Territory`

1.9 Region

AttributeValue
DefinitionAn administrative grouping of locations, agents, and territories
What it isA named area (e.g., "New York", "California") for organizational filtering
What it is NOTA territory (agent-assigned); a timezone; a country
LayerDomain / Administrative
Database Table`regions`
Swift Type`Region`

1.10 Invite

AttributeValue
DefinitionA token that allows a new user to join an organization
What it isA code (email or link-based) with role assignment and expiration
What it is NOTA membership; a user account; a permanent access token
LayerDomain / Access Control
Database Table`invites`
Swift Type`Invite`

1.11 Partner

AttributeValue
DefinitionA location that has been converted to an active customer
What it isA location with `is_partner = true` indicating active business relationship
What it is NOTA separate entity from Location; a different table; a user
LayerDomain / Status
Database Column`locations.is_partner`
Swift Property`Location.isPartner`

1.12 Lead

AttributeValue
DefinitionA location in early sales pipeline stages
What it isA location with stage in [prospecting, contacted, qualified]
What it is NOTA separate entity; a contact person; an opportunity
LayerDomain / Status
Database Column`locations.stage`
Swift Property`Location.stage`

---

2. Architectural Layer Terms

These terms describe system structure and components.

2.1 Tenant

AttributeValue
DefinitionThe data isolation boundary; synonymous with Organization in this system
What it isThe unit of data separation enforced by RLS
What it is NOTA physical database; a schema; a deployment
LayerArchitecture / Multi-tenancy
EnforcementRow Level Security via `organization_id`

2.2 Context (Singleton)

AttributeValue
DefinitionA shared, observable state container accessible throughout the app
What it isA @MainActor @Observable singleton holding current session state
What it is NOTA service (has no business logic); a view model; a database
LayerArchitecture / State Management
Examples`OrganizationContext`, `RegionContext`

2.3 Service

AttributeValue
DefinitionA class that encapsulates business logic and data operations
What it isAn @Observable class with async methods that interact with Supabase
What it is NOTA singleton (may be instantiated); a context (has logic); a model
LayerArchitecture / Business Logic
Examples`OrganizationService`, `LocationService`, `GooglePlacesService`

2.4 Model

AttributeValue
DefinitionA data structure representing a domain entity
What it isA Codable struct with properties matching database schema
What it is NOTA service (no methods beyond computed properties); a view model
LayerArchitecture / Data
Location`Milk Men/Models/`

2.5 Edge Function

AttributeValue
DefinitionA serverless function running on Supabase infrastructure
What it isTypeScript code executing server-side with access to secrets
What it is NOTA Swift function; a stored procedure; a webhook
LayerArchitecture / Backend
Location`supabase/functions/`

2.6 RLS (Row Level Security)

AttributeValue
DefinitionPostgreSQL policy that filters data access at the database level
What it isSQL policies attached to tables controlling SELECT/INSERT/UPDATE/DELETE
What it is NOTApplication-level filtering; an API middleware; encryption
LayerArchitecture / Security

---

3. Runtime Layer Terms

These terms describe runtime concepts and behaviors.

3.1 Demo Mode

AttributeValue
DefinitionA special app state using local sample data without authentication
What it isA boolean flag enabling offline exploration with fake data
What it is NOTA test environment; a sandbox; a trial period
LayerRuntime / Mode
Swift Property`AuthService.isDemoMode`

3.2 Onboarding

AttributeValue
DefinitionThe multi-step flow for new users to create or join an organization
What it isA modal flow: Choice → Vertical → Setup → Invite
What it is NOTAccount creation (happens before); a tutorial; settings
LayerRuntime / Flow
Swift View`OnboardingContainerView`

3.3 Enrichment

AttributeValue
DefinitionThe process of augmenting a Location with Google Places data
What it isFetching and storing photos, ratings, hours, reviews from Google
What it is NOTLocation creation; data import; manual editing
LayerRuntime / Process
Swift Method`GooglePlacesService.enrichLocation()`

3.4 Sync

AttributeValue
DefinitionThe process of reconciling local (offline) data with server state
What it isUploading queued changes and downloading updates
What it is NOTReal-time updates; cache refresh; backup
LayerRuntime / Process
Swift Service`SyncService`

---

4. External System Terms

4.1 Google Place

AttributeValue
DefinitionA business entity in Google's Places database
What it isExternal data with place_id, name, coordinates, photos, reviews
What it is NOTA Location in our system (until imported); a Google account
LayerExternal / Google
Swift Type`GooglePlaceResult`, `GooglePlaceDetails`

4.2 Square POS

AttributeValue
DefinitionSquare's Point of Sale application for payment processing
What it isExternal app launched via URL scheme to process transactions
What it is NOTOur payment system; a Square account; Square's API directly
LayerExternal / Payments

4.3 Supabase

AttributeValue
DefinitionThe backend-as-a-service platform providing database, auth, and functions
What it isPostgreSQL + Auth + Edge Functions + Storage
What it is NOTA generic database; Firebase; our code
LayerExternal / Backend

---

5. Terminology System Terms

5.1 Terminology Key

AttributeValue
DefinitionA standardized key for retrieving vertical-specific display text
What it isAn enum case (e.g., `.location`, `.visit`, `.agent`)
What it is NOTA localization key; a database column; a variable name
LayerSystem / Configuration
Swift Type`TerminologyKey`

5.2 Terminology Provider

AttributeValue
DefinitionThe singleton that resolves terminology keys to display strings
What it isA service mapping keys to vertical-specific terms
What it is NOTLocalization (i18n); a dictionary; a model
LayerSystem / Configuration
Swift Type`TerminologyProvider`

---

Revision History

VersionDateChanges
1.0.0-DRAFT2025-12-26Initial glossary with 25 terms

---

All code, documentation, and discussion must use terms as defined in this glossary.

Promotion Decision

Attach run IDs, datasets, metrics, and reproduction commands.

Source Anchor

Milk Men/Documentation/Phase-0-Control/0.1.2-SYSTEM-GLOSSARY.md

Detected Structure

Method · Evaluation · Architecture