@prmichaelsen/remember-mcp 3.19.3 → 3.20.1

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 (102) hide show
  1. package/AGENT.md +10 -3
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +1 -1
  4. package/agent/commands/acp.artifact-glossary.md +530 -0
  5. package/agent/commands/acp.artifact-reference.md +591 -0
  6. package/agent/commands/acp.artifact-research.md +594 -0
  7. package/agent/commands/acp.audit.md +345 -0
  8. package/agent/commands/acp.clarification-address.md +185 -88
  9. package/agent/commands/acp.clarification-capture.md +44 -44
  10. package/agent/commands/acp.clarification-create.md +41 -42
  11. package/agent/commands/acp.command-create.md +49 -49
  12. package/agent/commands/acp.design-create.md +53 -35
  13. package/agent/commands/acp.design-reference.md +42 -42
  14. package/agent/commands/acp.handoff.md +35 -35
  15. package/agent/commands/acp.index.md +47 -47
  16. package/agent/commands/acp.init.md +105 -69
  17. package/agent/commands/acp.package-create.md +41 -41
  18. package/agent/commands/acp.package-info.md +40 -40
  19. package/agent/commands/acp.package-install.md +48 -48
  20. package/agent/commands/acp.package-list.md +40 -40
  21. package/agent/commands/acp.package-publish.md +62 -62
  22. package/agent/commands/acp.package-remove.md +41 -41
  23. package/agent/commands/acp.package-search.md +48 -48
  24. package/agent/commands/acp.package-update.md +50 -50
  25. package/agent/commands/acp.package-validate.md +52 -52
  26. package/agent/commands/acp.pattern-create.md +61 -43
  27. package/agent/commands/acp.plan.md +70 -47
  28. package/agent/commands/acp.proceed.md +188 -66
  29. package/agent/commands/acp.project-create.md +42 -42
  30. package/agent/commands/acp.project-info.md +46 -46
  31. package/agent/commands/acp.project-list.md +41 -41
  32. package/agent/commands/acp.project-remove.md +36 -36
  33. package/agent/commands/acp.project-set.md +33 -33
  34. package/agent/commands/acp.project-update.md +57 -57
  35. package/agent/commands/acp.projects-restore.md +37 -37
  36. package/agent/commands/acp.projects-sync.md +39 -39
  37. package/agent/commands/acp.report.md +50 -50
  38. package/agent/commands/acp.resume.md +36 -36
  39. package/agent/commands/acp.sessions.md +46 -46
  40. package/agent/commands/acp.status.md +43 -43
  41. package/agent/commands/acp.sync.md +109 -56
  42. package/agent/commands/acp.task-create.md +51 -49
  43. package/agent/commands/acp.update.md +66 -45
  44. package/agent/commands/acp.validate.md +110 -52
  45. package/agent/commands/acp.version-check-for-updates.md +40 -40
  46. package/agent/commands/acp.version-check.md +36 -36
  47. package/agent/commands/acp.version-update.md +43 -43
  48. package/agent/commands/command.template.md +40 -40
  49. package/agent/commands/git.commit.md +28 -28
  50. package/agent/commands/git.init.md +48 -48
  51. package/agent/design/design.template.md +9 -9
  52. package/agent/design/local.admin-debugging-tools.md +242 -0
  53. package/agent/design/requirements.template.md +8 -8
  54. package/agent/index/.gitkeep +0 -0
  55. package/agent/index/acp.core.yaml +137 -0
  56. package/agent/index/local.main.template.yaml +37 -0
  57. package/agent/index/local.main.yaml +48 -0
  58. package/agent/manifest.yaml +64 -0
  59. package/agent/milestones/milestone-1-{title}.template.md +8 -8
  60. package/agent/milestones/milestone-22-admin-debugging-tools.md +61 -0
  61. package/agent/patterns/pattern.template.md +22 -22
  62. package/agent/progress.template.yaml +13 -3
  63. package/agent/progress.yaml +78 -1
  64. package/agent/schemas/package.schema.yaml +276 -0
  65. package/agent/scripts/acp.project-update.sh +5 -6
  66. package/agent/tasks/milestone-22-admin-debugging-tools/task-520-admin-gate-infrastructure.md +99 -0
  67. package/agent/tasks/milestone-22-admin-debugging-tools/task-521-schema-and-collection-tools.md +108 -0
  68. package/agent/tasks/milestone-22-admin-debugging-tools/task-522-memory-inspection-tools.md +120 -0
  69. package/agent/tasks/milestone-22-admin-debugging-tools/task-523-user-inspection-tools.md +126 -0
  70. package/agent/tasks/milestone-22-admin-debugging-tools/task-524-health-and-drift-tools.md +120 -0
  71. package/agent/tasks/task-1-{title}.template.md +18 -18
  72. package/dist/server-factory.js +637 -41
  73. package/dist/tools/admin-collection-stats.d.ts +24 -0
  74. package/dist/tools/admin-detect-weaviate-drift.d.ts +26 -0
  75. package/dist/tools/admin-get-weaviate-schema.d.ts +24 -0
  76. package/dist/tools/admin-health-drift.spec.d.ts +5 -0
  77. package/dist/tools/admin-health.d.ts +15 -0
  78. package/dist/tools/admin-inspect-memory.d.ts +29 -0
  79. package/dist/tools/admin-inspect-user.d.ts +73 -0
  80. package/dist/tools/admin-inspect-user.spec.d.ts +5 -0
  81. package/dist/tools/admin-list-collections.d.ts +23 -0
  82. package/dist/tools/admin-memory-inspection.spec.d.ts +7 -0
  83. package/dist/tools/admin-schema-collection.spec.d.ts +8 -0
  84. package/dist/tools/admin-search-across-users.d.ts +42 -0
  85. package/dist/utils/admin.d.ts +21 -0
  86. package/dist/utils/admin.spec.d.ts +2 -0
  87. package/package.json +2 -2
  88. package/src/server-factory.ts +131 -42
  89. package/src/tools/admin-collection-stats.ts +67 -0
  90. package/src/tools/admin-detect-weaviate-drift.ts +110 -0
  91. package/src/tools/admin-get-weaviate-schema.ts +68 -0
  92. package/src/tools/admin-health-drift.spec.ts +193 -0
  93. package/src/tools/admin-health.ts +88 -0
  94. package/src/tools/admin-inspect-memory.ts +86 -0
  95. package/src/tools/admin-inspect-user.spec.ts +130 -0
  96. package/src/tools/admin-inspect-user.ts +148 -0
  97. package/src/tools/admin-list-collections.ts +73 -0
  98. package/src/tools/admin-memory-inspection.spec.ts +206 -0
  99. package/src/tools/admin-schema-collection.spec.ts +167 -0
  100. package/src/tools/admin-search-across-users.ts +104 -0
  101. package/src/utils/admin.spec.ts +70 -0
  102. package/src/utils/admin.ts +27 -0
@@ -0,0 +1,126 @@
1
+ # Task 523: User Inspection Tools
2
+
3
+ **Milestone**: [M22 — Admin Debugging Tools](../../milestones/milestone-22-admin-debugging-tools.md)
4
+ **Design Reference**: [local.admin-debugging-tools.md](../../design/local.admin-debugging-tools.md)
5
+ **Status**: Not Started
6
+ **Estimated Time**: 2-3 hours
7
+ **Dependencies**: [Task 520](task-520-admin-gate-infrastructure.md)
8
+
9
+ ---
10
+
11
+ ## Objective
12
+
13
+ Implement four granular admin tools for inspecting Firestore user data: `remember_admin_inspect_user_preferences`, `remember_admin_inspect_user_ghost_configs`, `remember_admin_inspect_user_escalation_records`, and `remember_admin_inspect_user_api_tokens`.
14
+
15
+ ## Context
16
+
17
+ User data is spread across multiple Firestore collections. Rather than a single monolithic inspect tool, these are split into granular tools per data type — allowing precise queries and avoiding returning unnecessary data. Note: `space_configs` is excluded because it is not user-scoped.
18
+
19
+ ## Steps
20
+
21
+ ### 1. Implement `remember_admin_inspect_user_preferences`
22
+
23
+ Create `src/tools/admin-inspect-user-preferences.ts`:
24
+
25
+ **Input**:
26
+ ```typescript
27
+ { user_id: string }
28
+ ```
29
+
30
+ **Output**: Full user preferences document from Firestore, including all categories (templates, search, location, privacy, notifications, display).
31
+
32
+ **Implementation**:
33
+ - Use remember-core preference service to fetch user preferences
34
+ - Guard with `isAdmin(userId)` check
35
+ - Return default preferences if none set (same as `remember_get_preferences` behavior, but for any user)
36
+
37
+ ### 2. Implement `remember_admin_inspect_user_ghost_configs`
38
+
39
+ Create `src/tools/admin-inspect-user-ghost-configs.ts`:
40
+
41
+ **Input**:
42
+ ```typescript
43
+ { user_id: string }
44
+ ```
45
+
46
+ **Output**: All ghost configurations for the user — trust mode, content type filters, blocked users, etc.
47
+
48
+ **Implementation**:
49
+ - Use remember-core ghost config service to fetch all configs for user
50
+ - Guard with `isAdmin(userId)` check
51
+ - Return empty array if no ghost configs exist
52
+
53
+ ### 3. Implement `remember_admin_inspect_user_escalation_records`
54
+
55
+ Create `src/tools/admin-inspect-user-escalation-records.ts`:
56
+
57
+ **Input**:
58
+ ```typescript
59
+ { user_id: string }
60
+ ```
61
+
62
+ **Output**: All escalation records for the user — trust escalation attempts, blocked interactions, timestamps.
63
+
64
+ **Implementation**:
65
+ - Use remember-core escalation service to fetch records for user
66
+ - Guard with `isAdmin(userId)` check
67
+ - Return empty array if no records exist
68
+
69
+ ### 4. Implement `remember_admin_inspect_user_api_tokens`
70
+
71
+ Create `src/tools/admin-inspect-user-api-tokens.ts`:
72
+
73
+ **Input**:
74
+ ```typescript
75
+ { user_id: string }
76
+ ```
77
+
78
+ **Output**: API token metadata (no hashes, no raw tokens):
79
+ - Token name/label
80
+ - Created date
81
+ - Last used date
82
+ - Scopes
83
+ - Disabled status
84
+
85
+ **Implementation**:
86
+ - Query Firestore `api_tokens` collection where `user_id` matches
87
+ - Exclude `token_hash` field from response — only return metadata
88
+ - Guard with `isAdmin(userId)` check
89
+ - Return empty array if no tokens exist
90
+
91
+ ### 5. Add Unit Tests
92
+
93
+ Create spec files for each tool:
94
+ - `src/tools/admin-inspect-user-preferences.spec.ts`
95
+ - `src/tools/admin-inspect-user-ghost-configs.spec.ts`
96
+ - `src/tools/admin-inspect-user-escalation-records.spec.ts`
97
+ - `src/tools/admin-inspect-user-api-tokens.spec.ts`
98
+
99
+ Test cases per tool:
100
+ - Admin fetches data for existing user → returns data
101
+ - Admin fetches data for user with no data → returns defaults/empty
102
+ - Non-admin → permission error
103
+ - Invalid user_id → appropriate error
104
+
105
+ Additional for api_tokens:
106
+ - Token hash is never included in response
107
+
108
+ ---
109
+
110
+ ## Verification
111
+
112
+ - [ ] Each tool returns correct Firestore data for the specified user
113
+ - [ ] Each tool returns defaults/empty for users with no data
114
+ - [ ] `inspect_user_api_tokens` never returns token hashes
115
+ - [ ] All four tools reject non-admin users
116
+ - [ ] All four tools registered conditionally (hidden from non-admins)
117
+ - [ ] Unit tests pass for all four tools
118
+ - [ ] Uses remember-core services (not direct Firestore calls from tool handlers)
119
+
120
+ ## Key Design Decisions
121
+
122
+ | Decision | Choice | Rationale |
123
+ |---|---|---|
124
+ | inspect_user granularity | Separate tools per data type | Allows precise queries; avoids returning unnecessary data |
125
+ | space_configs | Excluded | Not user-scoped data |
126
+ | api_tokens | Metadata only, no hashes | Security — token hashes must never be exposed |
@@ -0,0 +1,120 @@
1
+ # Task 524: Health and Drift Tools
2
+
3
+ **Milestone**: [M22 — Admin Debugging Tools](../../milestones/milestone-22-admin-debugging-tools.md)
4
+ **Design Reference**: [local.admin-debugging-tools.md](../../design/local.admin-debugging-tools.md)
5
+ **Status**: Not Started
6
+ **Estimated Time**: 2-3 hours
7
+ **Dependencies**: [Task 520](task-520-admin-gate-infrastructure.md)
8
+
9
+ ---
10
+
11
+ ## Objective
12
+
13
+ Implement two admin tools: `remember_admin_health` (deep connectivity check) and `remember_admin_detect_weaviate_drift` (expected vs actual schema comparison).
14
+
15
+ ## Context
16
+
17
+ `health` is a simple connectivity check — can we reach Weaviate and Firestore? `detect_weaviate_drift` is a more detailed diagnostic that compares the expected schema (as defined in code) against the actual schema in Weaviate, identifying missing properties, type mismatches, and unexpected fields.
18
+
19
+ ## Steps
20
+
21
+ ### 1. Implement `remember_admin_health`
22
+
23
+ Create `src/tools/admin-health.ts`:
24
+
25
+ **Input**:
26
+ ```typescript
27
+ {} // No parameters — checks all services
28
+ ```
29
+
30
+ **Output**:
31
+ ```typescript
32
+ {
33
+ weaviate: { status: 'ok' | 'error', message?: string, latency_ms?: number },
34
+ firestore: { status: 'ok' | 'error', message?: string, latency_ms?: number },
35
+ overall: 'healthy' | 'degraded' | 'unhealthy'
36
+ }
37
+ ```
38
+
39
+ **Implementation**:
40
+ - Weaviate: attempt a simple meta query (e.g., `client.getMeta()`) and measure latency
41
+ - Firestore: attempt a simple read (e.g., read a known document or list collection) and measure latency
42
+ - Overall: `healthy` if both ok, `degraded` if one fails, `unhealthy` if both fail
43
+ - Guard with `isAdmin(userId)` check
44
+ - No schema drift detection (that's the separate tool)
45
+ - No per-user memory counts
46
+
47
+ ### 2. Implement `remember_admin_detect_weaviate_drift`
48
+
49
+ Create `src/tools/admin-detect-weaviate-drift.ts`:
50
+
51
+ **Input**:
52
+ ```typescript
53
+ {
54
+ collection_ids?: string[]; // Optional — check specific collections, or sample if omitted
55
+ }
56
+ ```
57
+
58
+ **Output**: Per-collection comparison:
59
+ ```typescript
60
+ {
61
+ collection: string;
62
+ status: 'match' | 'drift' | 'error';
63
+ expected_properties: string[]; // Properties defined in code
64
+ actual_properties: string[]; // Properties in Weaviate
65
+ missing_properties: string[]; // In code but not in Weaviate
66
+ extra_properties: string[]; // In Weaviate but not in code
67
+ type_mismatches: Array<{ property: string, expected: string, actual: string }>;
68
+ }
69
+ ```
70
+
71
+ **Implementation**:
72
+ - Get expected schema from remember-core schema definitions (the property lists defined in code)
73
+ - Get actual schema from Weaviate collection inspection
74
+ - Compare property names, types, and index settings
75
+ - Report differences per collection
76
+ - If no `collection_ids` provided, check a sample of collections (e.g., first user collection, spaces_public)
77
+ - Guard with `isAdmin(userId)` check
78
+
79
+ ### 3. Add Unit Tests
80
+
81
+ Create spec files:
82
+ - `src/tools/admin-health.spec.ts`
83
+ - `src/tools/admin-detect-weaviate-drift.spec.ts`
84
+
85
+ Test cases for `health`:
86
+ - Both services reachable → overall: healthy
87
+ - Weaviate down, Firestore up → overall: degraded
88
+ - Both down → overall: unhealthy
89
+ - Non-admin → permission error
90
+ - Latency included in response
91
+
92
+ Test cases for `detect_weaviate_drift`:
93
+ - Schema matches expected → status: match, empty diff arrays
94
+ - Missing property → reported in missing_properties
95
+ - Extra property → reported in extra_properties
96
+ - Type mismatch → reported in type_mismatches
97
+ - Specific collection_ids → only checks those
98
+ - No collection_ids → checks sample
99
+ - Non-admin → permission error
100
+
101
+ ### 4. Update CHANGELOG and README
102
+
103
+ - Add M22 admin tools to CHANGELOG.md
104
+ - Update README.md tool count and add admin tools section
105
+ - Version bump (patch or minor as appropriate)
106
+
107
+ ---
108
+
109
+ ## Verification
110
+
111
+ - [ ] `health` checks Weaviate and Firestore connectivity with latency
112
+ - [ ] `health` returns correct overall status (healthy/degraded/unhealthy)
113
+ - [ ] `detect_weaviate_drift` compares expected vs actual schema properties
114
+ - [ ] `detect_weaviate_drift` reports missing, extra, and type-mismatched properties
115
+ - [ ] `detect_weaviate_drift` accepts optional collection_ids filter
116
+ - [ ] Both tools reject non-admin users
117
+ - [ ] Both tools registered conditionally (hidden from non-admins)
118
+ - [ ] Unit tests pass for both tools
119
+ - [ ] CHANGELOG updated with M22 admin tools
120
+ - [ ] README updated with new tool count and admin section
@@ -1,10 +1,10 @@
1
1
  # Task {N}: {Descriptive Task Name}
2
2
 
3
- **Milestone**: [M{N} - Milestone Name](../milestones/milestone-{N}-{name}.md)
4
- **Design Reference**: [{Design Name}](../design/{namespace}.{design-name}.md) | None
5
- **Estimated Time**: [e.g., "2 hours", "4 hours", "1 day"]
6
- **Dependencies**: [List prerequisite tasks, or "None"]
7
- **Status**: Not Started | In Progress | Completed
3
+ **Milestone**: [M{N} - Milestone Name](../milestones/milestone-{N}-{name}.md)
4
+ **Design Reference**: [{Design Name}](../design/{namespace}.{design-name}.md) | None
5
+ **Estimated Time**: [e.g., "2 hours", "4 hours", "1 day"]
6
+ **Dependencies**: [List prerequisite tasks, or "None"]
7
+ **Status**: Not Started | In Progress | Completed
8
8
 
9
9
  ---
10
10
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  [Clearly state what this task accomplishes. Be specific and focused on a single, achievable goal.]
14
14
 
15
- **Example**: "Create the basic project structure with all necessary configuration files and directory organization for a TypeScript-based MCP server."
15
+ **Example**: "Create the basic project structure with all necessary configuration files and directory organization for a TypeScript-based MCP server."
16
16
 
17
17
  ---
18
18
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  [Provide background information that helps understand why this task is necessary and how it fits into the larger milestone.]
22
22
 
23
- **Example**: "This task establishes the foundation for the project. Without proper structure and configuration, subsequent development tasks cannot proceed. The structure follows industry best practices for TypeScript projects and MCP server organization."
23
+ **Example**: "This task establishes the foundation for the project. Without proper structure and configuration, subsequent development tasks cannot proceed. The structure follows industry best practices for TypeScript projects and MCP server organization."
24
24
 
25
25
  ---
26
26
 
@@ -190,22 +190,22 @@ project-root/
190
190
  [Document potential problems and how to resolve them:]
191
191
 
192
192
  ### Issue 1: [Problem description]
193
- **Symptom**: [What the user will see]
194
- **Solution**: [How to fix it]
193
+ **Symptom**: [What the user will see]
194
+ **Solution**: [How to fix it]
195
195
 
196
196
  ### Issue 2: [Problem description]
197
- **Symptom**: [What the user will see]
198
- **Solution**: [How to fix it]
197
+ **Symptom**: [What the user will see]
198
+ **Solution**: [How to fix it]
199
199
 
200
200
  **Example**:
201
201
 
202
202
  ### Issue 1: npm init fails
203
- **Symptom**: Error message about permissions or missing npm
204
- **Solution**: Ensure Node.js and npm are installed correctly. Run `node --version` and `npm --version` to verify.
203
+ **Symptom**: Error message about permissions or missing npm
204
+ **Solution**: Ensure Node.js and npm are installed correctly. Run `node --version` and `npm --version` to verify.
205
205
 
206
206
  ### Issue 2: TypeScript configuration errors
207
- **Symptom**: tsc complains about invalid configuration
208
- **Solution**: Validate JSON syntax in tsconfig.json. Ensure all required fields are present.
207
+ **Symptom**: tsc complains about invalid configuration
208
+ **Solution**: Validate JSON syntax in tsconfig.json. Ensure all required fields are present.
209
209
 
210
210
  ---
211
211
 
@@ -239,6 +239,6 @@ project-root/
239
239
 
240
240
  ---
241
241
 
242
- **Next Task**: [Link to next task: task-{N+1}-{name}.md]
243
- **Related Design Docs**: [Links to relevant design documents]
244
- **Estimated Completion Date**: [YYYY-MM-DD or "TBD"]
242
+ **Next Task**: [Link to next task: task-{N+1}-{name}.md]
243
+ **Related Design Docs**: [Links to relevant design documents]
244
+ **Estimated Completion Date**: [YYYY-MM-DD or "TBD"]