@prmichaelsen/remember-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/.env.example +65 -0
  2. package/AGENT.md +840 -0
  3. package/README.md +72 -0
  4. package/agent/design/.gitkeep +0 -0
  5. package/agent/design/access-control-result-pattern.md +458 -0
  6. package/agent/design/action-audit-memory-types.md +637 -0
  7. package/agent/design/common-template-fields.md +282 -0
  8. package/agent/design/complete-tool-set.md +407 -0
  9. package/agent/design/content-types-expansion.md +521 -0
  10. package/agent/design/cross-database-id-strategy.md +358 -0
  11. package/agent/design/default-template-library.md +423 -0
  12. package/agent/design/firestore-wrapper-analysis.md +606 -0
  13. package/agent/design/llm-provider-abstraction.md +691 -0
  14. package/agent/design/location-handling-architecture.md +523 -0
  15. package/agent/design/memory-templates-design.md +364 -0
  16. package/agent/design/permissions-storage-architecture.md +680 -0
  17. package/agent/design/relationship-storage-strategy.md +361 -0
  18. package/agent/design/remember-mcp-implementation-tasks.md +417 -0
  19. package/agent/design/remember-mcp-progress.yaml +141 -0
  20. package/agent/design/requirements-enhancements.md +468 -0
  21. package/agent/design/requirements.md +56 -0
  22. package/agent/design/template-storage-strategy.md +412 -0
  23. package/agent/design/template-suggestion-system.md +853 -0
  24. package/agent/design/trust-escalation-prevention.md +343 -0
  25. package/agent/design/trust-system-implementation.md +592 -0
  26. package/agent/design/user-preferences.md +683 -0
  27. package/agent/design/weaviate-collection-strategy.md +461 -0
  28. package/agent/milestones/.gitkeep +0 -0
  29. package/agent/milestones/milestone-1-project-foundation.md +121 -0
  30. package/agent/milestones/milestone-2-core-memory-system.md +150 -0
  31. package/agent/milestones/milestone-3-relationships-graph.md +116 -0
  32. package/agent/milestones/milestone-4-user-preferences.md +103 -0
  33. package/agent/milestones/milestone-5-template-system.md +126 -0
  34. package/agent/milestones/milestone-6-auth-multi-tenancy.md +124 -0
  35. package/agent/milestones/milestone-7-trust-permissions.md +133 -0
  36. package/agent/milestones/milestone-8-testing-quality.md +137 -0
  37. package/agent/milestones/milestone-9-deployment-documentation.md +147 -0
  38. package/agent/patterns/.gitkeep +0 -0
  39. package/agent/patterns/bootstrap.md +1271 -0
  40. package/agent/patterns/firebase-admin-sdk-v8-usage.md +950 -0
  41. package/agent/patterns/firestore-users-pattern-best-practices.md +347 -0
  42. package/agent/patterns/library-services.md +454 -0
  43. package/agent/patterns/testing-colocated.md +316 -0
  44. package/agent/progress.yaml +395 -0
  45. package/agent/tasks/.gitkeep +0 -0
  46. package/agent/tasks/task-1-initialize-project-structure.md +266 -0
  47. package/agent/tasks/task-2-install-dependencies.md +199 -0
  48. package/agent/tasks/task-3-setup-weaviate-client.md +330 -0
  49. package/agent/tasks/task-4-setup-firestore-client.md +362 -0
  50. package/agent/tasks/task-5-create-basic-mcp-server.md +114 -0
  51. package/agent/tasks/task-6-create-integration-tests.md +195 -0
  52. package/agent/tasks/task-7-finalize-milestone-1.md +363 -0
  53. package/agent/tasks/task-8-setup-utility-scripts.md +382 -0
  54. package/agent/tasks/task-9-create-server-factory.md +404 -0
  55. package/dist/config.d.ts +26 -0
  56. package/dist/constants/content-types.d.ts +60 -0
  57. package/dist/firestore/init.d.ts +14 -0
  58. package/dist/firestore/paths.d.ts +53 -0
  59. package/dist/firestore/paths.spec.d.ts +2 -0
  60. package/dist/server-factory.d.ts +40 -0
  61. package/dist/server-factory.js +1741 -0
  62. package/dist/server-factory.spec.d.ts +2 -0
  63. package/dist/server.d.ts +3 -0
  64. package/dist/server.js +1690 -0
  65. package/dist/tools/create-memory.d.ts +94 -0
  66. package/dist/tools/delete-memory.d.ts +47 -0
  67. package/dist/tools/search-memory.d.ts +88 -0
  68. package/dist/types/memory.d.ts +183 -0
  69. package/dist/utils/logger.d.ts +7 -0
  70. package/dist/weaviate/client.d.ts +39 -0
  71. package/dist/weaviate/client.spec.d.ts +2 -0
  72. package/dist/weaviate/schema.d.ts +29 -0
  73. package/esbuild.build.js +60 -0
  74. package/esbuild.watch.js +25 -0
  75. package/jest.config.js +31 -0
  76. package/jest.e2e.config.js +17 -0
  77. package/package.json +68 -0
  78. package/src/.gitkeep +0 -0
  79. package/src/config.ts +56 -0
  80. package/src/constants/content-types.ts +454 -0
  81. package/src/firestore/init.ts +68 -0
  82. package/src/firestore/paths.spec.ts +75 -0
  83. package/src/firestore/paths.ts +124 -0
  84. package/src/server-factory.spec.ts +60 -0
  85. package/src/server-factory.ts +215 -0
  86. package/src/server.ts +243 -0
  87. package/src/tools/create-memory.ts +198 -0
  88. package/src/tools/delete-memory.ts +126 -0
  89. package/src/tools/search-memory.ts +216 -0
  90. package/src/types/memory.ts +276 -0
  91. package/src/utils/logger.ts +42 -0
  92. package/src/weaviate/client.spec.ts +58 -0
  93. package/src/weaviate/client.ts +114 -0
  94. package/src/weaviate/schema.ts +288 -0
  95. package/tsconfig.json +26 -0
@@ -0,0 +1,150 @@
1
+ # Milestone 2: Core Memory System
2
+
3
+ **Goal**: Implement basic memory CRUD operations with user isolation
4
+ **Duration**: 2 weeks
5
+ **Dependencies**: M1 (Project Foundation)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Implement the core memory system with create, read, update, delete, and search operations. Establish user isolation with per-user Weaviate collections.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Memory Schema
19
+ - Complete Memory interface (25+ fields)
20
+ - Weaviate schema for Memory_{user_id} collection
21
+ - Support for doc_type discriminator
22
+ - Vector embedding configuration
23
+
24
+ ### 2. Memory CRUD Tools (6 tools)
25
+ - remember_create_memory
26
+ - remember_update_memory
27
+ - remember_delete_memory
28
+ - remember_search_memory (hybrid search)
29
+ - remember_find_similar
30
+ - remember_query_memory (RAG)
31
+
32
+ ### 3. User Isolation
33
+ - Per-user collection naming: Memory_{sanitized_user_id}
34
+ - Collection creation on first use
35
+ - Verify no cross-user data access
36
+
37
+ ### 4. Context Integration
38
+ - Extract location from request context
39
+ - Extract locale and timezone from cookies
40
+ - Store context with each memory
41
+
42
+ ---
43
+
44
+ ## Success Criteria
45
+
46
+ - [ ] Can create memories with all fields (content, type, weight, trust, location, context)
47
+ - [ ] Can search memories semantically (hybrid search working)
48
+ - [ ] Can update memories (version tracking works)
49
+ - [ ] Can delete memories
50
+ - [ ] Can find similar memories
51
+ - [ ] RAG queries return relevant answers
52
+ - [ ] User data completely isolated (tested with multiple users)
53
+ - [ ] Location and locale stored correctly from cookies
54
+
55
+ ---
56
+
57
+ ## Key Files to Create
58
+
59
+ ```
60
+ src/
61
+ ├── types/
62
+ │ ├── memory.ts # Memory interface
63
+ │ ├── context.ts # RequestContext interface
64
+ │ └── location.ts # Location/Locale interfaces
65
+ ├── weaviate/
66
+ │ └── memory-schema.ts # Weaviate schema definition
67
+ ├── tools/
68
+ │ ├── create-memory.ts
69
+ │ ├── update-memory.ts
70
+ │ ├── delete-memory.ts
71
+ │ ├── search-memory.ts
72
+ │ ├── find-similar.ts
73
+ │ └── query-memory.ts
74
+ └── services/
75
+ └── context-extractor.ts # Extract location/locale from cookies
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Memory Schema (Weaviate)
81
+
82
+ ```yaml
83
+ Memory_{user_id}:
84
+ # Discriminator
85
+ doc_type: text # "memory" or "relationship"
86
+
87
+ # Core
88
+ user_id: text
89
+ content: text # Vectorized
90
+ title: text
91
+ summary: text
92
+ type: text # Content type
93
+
94
+ # Scoring
95
+ weight: number # 0-1
96
+ trust: number # 0-1
97
+ confidence: number # 0-1
98
+
99
+ # Location (from cookies)
100
+ location_gps_lat: number
101
+ location_gps_lng: number
102
+ location_address: text
103
+ location_city: text
104
+ location_country: text
105
+
106
+ # Locale (from cookies)
107
+ locale_language: text
108
+ locale_timezone: text
109
+
110
+ # Context
111
+ context_conversation_id: text
112
+ context_summary: text
113
+ context_timestamp: date
114
+
115
+ # Relationships
116
+ relationships: text[] # Array of relationship IDs
117
+
118
+ # Access tracking
119
+ access_count: number
120
+ last_accessed_at: date
121
+
122
+ # Metadata
123
+ tags: text[]
124
+ references: text[] # Source URLs
125
+ created_at: date
126
+ updated_at: date
127
+ version: number
128
+
129
+ # Template
130
+ template_id: text
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Testing
136
+
137
+ - [ ] Create memory test
138
+ - [ ] Update memory test
139
+ - [ ] Delete memory test
140
+ - [ ] Search memory test (semantic + keyword)
141
+ - [ ] Find similar test
142
+ - [ ] RAG query test
143
+ - [ ] User isolation test (critical!)
144
+ - [ ] Location extraction test
145
+ - [ ] Locale extraction test
146
+
147
+ ---
148
+
149
+ **Next Milestone**: M3 - Relationships & Graph
150
+ **Blockers**: M1 must be complete
@@ -0,0 +1,116 @@
1
+ # Milestone 3: Relationships & Graph
2
+
3
+ **Goal**: Implement memory relationships stored in Memory collection
4
+ **Duration**: 1 week
5
+ **Dependencies**: M2 (Core Memory System)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Implement relationship system that connects memories together. Relationships are stored in the same Memory_{user_id} collection with doc_type: "relationship" for unified RAG queries.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Relationship Schema
19
+ - Relationship interface with free-form types
20
+ - Store in Memory_{user_id} with doc_type: "relationship"
21
+ - Support N-way relationships (2...N memories)
22
+ - Context with summary
23
+
24
+ ### 2. Relationship Tools (4 tools)
25
+ - remember_create_relationship
26
+ - remember_update_relationship
27
+ - remember_search_relationship
28
+ - remember_delete_relationship
29
+
30
+ ### 3. Bidirectional Tracking
31
+ - Update connected memories' relationships arrays
32
+ - Maintain consistency on create/delete
33
+ - Handle orphaned relationships
34
+
35
+ ### 4. Unified Queries
36
+ - Search memories and relationships together
37
+ - Filter by doc_type when needed
38
+ - RAG queries include relationship context
39
+
40
+ ---
41
+
42
+ ## Success Criteria
43
+
44
+ - [ ] Can create relationships between 2...N memories
45
+ - [ ] Relationship types are free-form strings (agent decides)
46
+ - [ ] Can search relationships by observation text
47
+ - [ ] Relationships and memories queryable together (single query)
48
+ - [ ] RAG includes relationship context
49
+ - [ ] Bidirectional updates work correctly
50
+ - [ ] Deleting memory handles relationships appropriately
51
+
52
+ ---
53
+
54
+ ## Key Files to Create
55
+
56
+ ```
57
+ src/
58
+ ├── types/
59
+ │ └── relationship.ts # Relationship interface
60
+ ├── tools/
61
+ │ ├── create-relationship.ts
62
+ │ ├── update-relationship.ts
63
+ │ ├── search-relationship.ts
64
+ │ └── delete-relationship.ts
65
+ └── services/
66
+ └── relationship-manager.ts # Bidirectional updates
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Relationship Schema (in Memory_{user_id})
72
+
73
+ ```yaml
74
+ Relationship (doc_type: "relationship"):
75
+ # Discriminator
76
+ doc_type: "relationship"
77
+
78
+ # Core
79
+ user_id: text
80
+ memory_ids: text[] # 2...N memory IDs
81
+ relationship_type: text # Free-form: "inspired_by", "contradicts", etc.
82
+
83
+ # Description
84
+ observation: text # Vectorized for semantic search
85
+ strength: number # 0-1
86
+ confidence: number # 0-1
87
+
88
+ # Context
89
+ context_conversation_id: text
90
+ context_summary: text
91
+ context_timestamp: date
92
+
93
+ # Metadata
94
+ tags: text[]
95
+ created_at: date
96
+ updated_at: date
97
+ version: number
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Testing
103
+
104
+ - [ ] Create 2-way relationship test
105
+ - [ ] Create N-way relationship test
106
+ - [ ] Search relationships test
107
+ - [ ] Update relationship test
108
+ - [ ] Delete relationship test
109
+ - [ ] Bidirectional update test
110
+ - [ ] Unified memory+relationship query test (RAG)
111
+ - [ ] Orphan handling test
112
+
113
+ ---
114
+
115
+ **Next Milestone**: M4 - User Preferences
116
+ **Blockers**: M2 must be complete
@@ -0,0 +1,103 @@
1
+ # Milestone 4: User Preferences
2
+
3
+ **Goal**: Implement user preference system with conversational management
4
+ **Duration**: 1 week
5
+ **Dependencies**: M2 (Core Memory System)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Implement user preferences stored in Firestore with tools to manage preferences through natural conversation.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Preferences Schema
19
+ - UserPreferences interface
20
+ - Default preferences
21
+ - Preference validation
22
+ - Store in users/{user_id}/preferences
23
+
24
+ ### 2. Preference Tools (2 tools)
25
+ - remember_update_preferences
26
+ - remember_get_preferences
27
+
28
+ ### 3. Preference Integration
29
+ - Template auto-suggest respects preferences
30
+ - Search uses preference defaults
31
+ - Trust defaults from preferences
32
+ - All tools check preferences
33
+
34
+ ---
35
+
36
+ ## Success Criteria
37
+
38
+ - [ ] Preferences stored in Firestore users/{user_id}/preferences
39
+ - [ ] Can update preferences via conversation
40
+ - [ ] Can query current preferences
41
+ - [ ] Template auto-suggest respects preferences.templates.auto_suggest
42
+ - [ ] Search uses preferences.search.default_limit
43
+ - [ ] New memories use preferences.privacy.default_trust_level
44
+ - [ ] Preference changes logged
45
+
46
+ ---
47
+
48
+ ## Key Files to Create
49
+
50
+ ```
51
+ src/
52
+ ├── types/
53
+ │ └── preferences.ts # UserPreferences interface
54
+ ├── firestore/
55
+ │ └── preferences.ts # Preference CRUD
56
+ ├── tools/
57
+ │ ├── update-preferences.ts
58
+ │ └── get-preferences.ts
59
+ └── services/
60
+ └── preference-manager.ts
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Preferences Schema (Firestore)
66
+
67
+ ```typescript
68
+ users/{user_id}/preferences:
69
+ templates:
70
+ auto_suggest: boolean (default: true)
71
+ suggestion_threshold: number (default: 0.6)
72
+ max_suggestions: number (default: 3)
73
+ suppressed_categories: string[]
74
+
75
+ search:
76
+ default_limit: number (default: 10)
77
+ default_alpha: number (default: 0.7)
78
+ weight_by_access: boolean (default: true)
79
+
80
+ privacy:
81
+ default_trust_level: number (default: 0.5)
82
+ allow_cross_user_access: boolean (default: false)
83
+
84
+ location:
85
+ auto_capture: boolean (default: true)
86
+ precision: string (default: "approximate")
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Testing
92
+
93
+ - [ ] Get preferences test (with defaults)
94
+ - [ ] Update preferences test
95
+ - [ ] Preference validation test
96
+ - [ ] Integration: template auto-suggest respects preferences
97
+ - [ ] Integration: search uses preference defaults
98
+ - [ ] Conversational preference update test
99
+
100
+ ---
101
+
102
+ **Next Milestone**: M5 - Template System
103
+ **Blockers**: M2 must be complete
@@ -0,0 +1,126 @@
1
+ # Milestone 5: Template System
2
+
3
+ **Goal**: Implement template system with default library and auto-suggestion
4
+ **Duration**: 2 weeks
5
+ **Dependencies**: M2 (Core Memory), M4 (Preferences)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Implement the template system with 15 default templates, auto-suggestion based on context, and user custom templates.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Template Schema
19
+ - Template interface
20
+ - Field definition schema
21
+ - Trigger configuration
22
+ - Store in Template_system and Template_{user_id}
23
+
24
+ ### 2. Default Template Library
25
+ - 15 curated default templates
26
+ - Person, Meeting Notes, Restaurant Review, Book Review, etc.
27
+ - Inventory Item template
28
+ - All templates include references, tags, notes fields
29
+
30
+ ### 3. Template Suggestion
31
+ - Keyword matching algorithm
32
+ - Context pattern matching
33
+ - Semantic similarity matching
34
+ - Scoring and ranking
35
+ - Integration with remember_create_memory
36
+
37
+ ### 4. Template Tools (6 tools)
38
+ - remember_create_template
39
+ - remember_list_templates
40
+ - remember_get_template
41
+ - remember_update_template
42
+ - remember_delete_template
43
+ - remember_copy_template
44
+
45
+ ### 5. Firestore Storage
46
+ - templates/default/{weaviate_uuid} for defaults
47
+ - users/{user_id}/templates/{weaviate_uuid} for user templates
48
+ - No sharing (promotion model instead)
49
+
50
+ ---
51
+
52
+ ## Success Criteria
53
+
54
+ - [ ] 15 default templates available to all users
55
+ - [ ] Template suggestion works based on keywords and context
56
+ - [ ] Users can create custom templates
57
+ - [ ] Users can copy and modify default templates
58
+ - [ ] Template validation works
59
+ - [ ] Auto-suggest respects user preferences
60
+ - [ ] Templates stored correctly in Firestore and Weaviate
61
+
62
+ ---
63
+
64
+ ## Key Files to Create
65
+
66
+ ```
67
+ src/
68
+ ├── types/
69
+ │ └── template.ts
70
+ ├── templates/
71
+ │ └── defaults/
72
+ │ ├── person.ts
73
+ │ ├── meeting-notes.ts
74
+ │ ├── restaurant-review.ts
75
+ │ ├── inventory-item.ts
76
+ │ └── ... (11 more)
77
+ ├── services/
78
+ │ ├── template-suggestion.ts
79
+ │ └── template-manager.ts
80
+ ├── tools/
81
+ │ ├── create-template.ts
82
+ │ ├── list-templates.ts
83
+ │ ├── get-template.ts
84
+ │ ├── update-template.ts
85
+ │ ├── delete-template.ts
86
+ │ └── copy-template.ts
87
+ └── firestore/
88
+ └── templates.ts
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Default Templates (15)
94
+
95
+ 1. Person - Unified personal/professional contacts
96
+ 2. Meeting Notes - Work meetings
97
+ 3. Project Tracker - Project management
98
+ 4. Task - Action items
99
+ 5. Journal Entry - Daily journaling
100
+ 6. Goal - Goal tracking
101
+ 7. Habit - Habit tracking
102
+ 8. Inventory Item - Home organization
103
+ 9. Restaurant Review - Dining experiences
104
+ 10. Book Review - Books read
105
+ 11. Movie Review - Movies/shows watched
106
+ 12. Recipe - Cooking recipes
107
+ 13. Idea - Quick ideas
108
+ 14. Learning Note - Things learned
109
+ 15. Travel Destination - Places visited
110
+
111
+ ---
112
+
113
+ ## Testing
114
+
115
+ - [ ] Template creation test
116
+ - [ ] Template suggestion test (keyword matching)
117
+ - [ ] Template suggestion test (context matching)
118
+ - [ ] Template validation test
119
+ - [ ] User template CRUD test
120
+ - [ ] Copy default template test
121
+ - [ ] Integration: create memory with template
122
+
123
+ ---
124
+
125
+ **Next Milestone**: M6 - Auth & Multi-Tenancy
126
+ **Blockers**: M2 and M4 must be complete
@@ -0,0 +1,124 @@
1
+ # Milestone 6: Authentication & Multi-Tenancy
2
+
3
+ **Goal**: Implement Firebase authentication and SSE transport
4
+ **Duration**: 1 week
5
+ **Dependencies**: M1-M5 (All previous milestones)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Integrate Firebase authentication for user identification and implement SSE transport for remote access. Verify multi-user isolation.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Firebase Authentication
19
+ - JWT token validation
20
+ - Extract user_id from token
21
+ - Auth error handling
22
+ - Token refresh handling
23
+
24
+ ### 2. Request Context Extraction
25
+ - Parse location from cookies
26
+ - Parse locale from cookies
27
+ - Parse timezone from cookies
28
+ - Validate context data
29
+
30
+ ### 3. SSE Transport
31
+ - HTTP server setup
32
+ - SSE endpoint implementation
33
+ - MCP protocol over SSE
34
+ - Connection management
35
+
36
+ ### 4. Multi-User Verification
37
+ - Test with multiple users simultaneously
38
+ - Verify data isolation
39
+ - Test concurrent operations
40
+ - Load testing
41
+
42
+ ---
43
+
44
+ ## Success Criteria
45
+
46
+ - [ ] Firebase JWT tokens validated correctly
47
+ - [ ] user_id extracted from tokens
48
+ - [ ] Invalid tokens rejected with clear errors
49
+ - [ ] Location extracted from cookies
50
+ - [ ] Locale and timezone extracted from cookies
51
+ - [ ] SSE transport works with MCP clients
52
+ - [ ] Multiple users can connect simultaneously
53
+ - [ ] User data completely isolated (no leaks)
54
+ - [ ] Performance acceptable with 100 concurrent users
55
+
56
+ ---
57
+
58
+ ## Key Files to Create
59
+
60
+ ```
61
+ src/
62
+ ├── auth/
63
+ │ ├── firebase-provider.ts
64
+ │ └── token-validator.ts
65
+ ├── transport/
66
+ │ ├── sse-server.ts
67
+ │ └── connection-manager.ts
68
+ ├── middleware/
69
+ │ ├── auth-middleware.ts
70
+ │ └── context-middleware.ts
71
+ └── services/
72
+ └── context-parser.ts
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Request Context Structure
78
+
79
+ ```typescript
80
+ RequestContext {
81
+ // Auth
82
+ user_id: string;
83
+ auth_token: string;
84
+
85
+ // Location (from cookies)
86
+ location: {
87
+ gps: { latitude, longitude, accuracy };
88
+ address: { formatted, city, state, country };
89
+ source: string;
90
+ confidence: number;
91
+ };
92
+
93
+ // Locale (from cookies)
94
+ locale: {
95
+ language: string;
96
+ country: string;
97
+ timezone: string;
98
+ currency: string;
99
+ };
100
+
101
+ // Session
102
+ timestamp: datetime;
103
+ session_id: string;
104
+ }
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Testing
110
+
111
+ - [ ] Valid JWT authentication test
112
+ - [ ] Invalid JWT rejection test
113
+ - [ ] Expired token test
114
+ - [ ] Location extraction test
115
+ - [ ] Locale extraction test
116
+ - [ ] SSE connection test
117
+ - [ ] Multi-user isolation test
118
+ - [ ] Concurrent user test
119
+ - [ ] Load test (100 users)
120
+
121
+ ---
122
+
123
+ **Next Milestone**: M7 - Trust & Permissions
124
+ **Blockers**: M1-M5 must be complete