@prmichaelsen/remember-mcp 2.3.4 → 2.5.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.
- package/AGENT.md +2 -2
- package/CHANGELOG.md +63 -0
- package/README.md +50 -5
- package/agent/commands/git.commit.md +511 -0
- package/agent/commands/git.init.md +513 -0
- package/agent/milestones/milestone-11-unified-public-collection.md +205 -0
- package/agent/scripts/install.sh +31 -16
- package/agent/scripts/update.sh +32 -17
- package/agent/tasks/task-45-fix-publish-false-success-bug.md +114 -181
- package/agent/tasks/task-46-update-spacememory-types.md +94 -0
- package/agent/tasks/task-47-update-space-schema.md +102 -0
- package/agent/tasks/task-48-create-memory-public-collection.md +96 -0
- package/agent/tasks/task-49-update-remember-publish.md +153 -0
- package/agent/tasks/task-50-update-remember-confirm.md +111 -0
- package/agent/tasks/task-51-update-remember-search-space.md +154 -0
- package/agent/tasks/task-52-update-remember-query-space.md +142 -0
- package/agent/tasks/task-53-add-multispace-tests.md +193 -0
- package/agent/tasks/task-54-update-documentation-multispace.md +191 -0
- package/dist/server-factory.js +203 -107
- package/dist/server.js +203 -107
- package/dist/tools/publish.d.ts +1 -1
- package/dist/tools/query-space.d.ts +1 -1
- package/dist/tools/search-space.d.ts +1 -1
- package/dist/types/space-memory.d.ts +5 -3
- package/dist/weaviate/space-schema.d.ts +16 -0
- package/package.json +1 -1
- package/src/services/confirmation-token.service.ts +74 -30
- package/src/tools/confirm.ts +15 -16
- package/src/tools/publish.ts +42 -20
- package/src/tools/query-space.ts +38 -24
- package/src/tools/search-space.ts +51 -28
- package/src/types/space-memory.ts +5 -3
- package/src/weaviate/space-schema.spec.ts +55 -0
- package/src/weaviate/space-schema.ts +45 -6
package/agent/scripts/install.sh
CHANGED
|
@@ -5,18 +5,28 @@
|
|
|
5
5
|
|
|
6
6
|
set -e
|
|
7
7
|
|
|
8
|
-
# Colors for output
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
# Colors for output using tput (more reliable than ANSI codes)
|
|
9
|
+
if command -v tput >/dev/null 2>&1 && [ -t 1 ]; then
|
|
10
|
+
RED=$(tput setaf 1)
|
|
11
|
+
GREEN=$(tput setaf 2)
|
|
12
|
+
YELLOW=$(tput setaf 3)
|
|
13
|
+
BLUE=$(tput setaf 4)
|
|
14
|
+
BOLD=$(tput bold)
|
|
15
|
+
NC=$(tput sgr0)
|
|
16
|
+
else
|
|
17
|
+
RED=''
|
|
18
|
+
GREEN=''
|
|
19
|
+
YELLOW=''
|
|
20
|
+
BLUE=''
|
|
21
|
+
BOLD=''
|
|
22
|
+
NC=''
|
|
23
|
+
fi
|
|
14
24
|
|
|
15
25
|
# Repository details
|
|
16
26
|
REPO_URL="https://github.com/prmichaelsen/agent-context-protocol.git"
|
|
17
27
|
BRANCH="mainline"
|
|
18
28
|
|
|
19
|
-
echo
|
|
29
|
+
echo "${GREEN}Agent Context Protocol (ACP) Installer${NC}"
|
|
20
30
|
echo "========================================"
|
|
21
31
|
echo ""
|
|
22
32
|
|
|
@@ -28,7 +38,7 @@ echo ""
|
|
|
28
38
|
|
|
29
39
|
# Check if agent directory already exists
|
|
30
40
|
if [ -d "$TARGET_DIR/agent" ]; then
|
|
31
|
-
echo
|
|
41
|
+
echo "${YELLOW}Note: agent/ directory already exists${NC}"
|
|
32
42
|
echo "All ACP files will be updated to latest versions."
|
|
33
43
|
echo ""
|
|
34
44
|
fi
|
|
@@ -39,12 +49,12 @@ trap "rm -rf $TEMP_DIR" EXIT
|
|
|
39
49
|
|
|
40
50
|
echo "Cloning ACP repository..."
|
|
41
51
|
if ! git clone --depth 1 --branch "$BRANCH" "$REPO_URL" "$TEMP_DIR" &>/dev/null; then
|
|
42
|
-
echo
|
|
52
|
+
echo "${RED}Error: Failed to clone repository${NC}"
|
|
43
53
|
echo "Please check your internet connection and try again."
|
|
44
54
|
exit 1
|
|
45
55
|
fi
|
|
46
56
|
|
|
47
|
-
echo
|
|
57
|
+
echo "${GREEN}✓${NC} Repository cloned"
|
|
48
58
|
echo ""
|
|
49
59
|
|
|
50
60
|
# Create directory structure
|
|
@@ -72,7 +82,7 @@ cat > "$TARGET_DIR/agent/.gitignore" << 'EOF'
|
|
|
72
82
|
reports/
|
|
73
83
|
EOF
|
|
74
84
|
|
|
75
|
-
echo
|
|
85
|
+
echo "${GREEN}✓${NC} Directory structure created"
|
|
76
86
|
echo ""
|
|
77
87
|
|
|
78
88
|
# Copy files
|
|
@@ -107,11 +117,11 @@ cp "$TEMP_DIR/agent/scripts/version.sh" "$TARGET_DIR/agent/scripts/"
|
|
|
107
117
|
cp "$TEMP_DIR/agent/scripts/install.sh" "$TARGET_DIR/agent/scripts/"
|
|
108
118
|
chmod +x "$TARGET_DIR/agent/scripts"/*.sh
|
|
109
119
|
|
|
110
|
-
echo
|
|
120
|
+
echo "${GREEN}✓${NC} All files installed"
|
|
111
121
|
echo ""
|
|
112
|
-
echo
|
|
122
|
+
echo "${GREEN}Installation complete!${NC}"
|
|
113
123
|
echo ""
|
|
114
|
-
echo
|
|
124
|
+
echo "${GREEN}Next steps:${NC}"
|
|
115
125
|
echo "1. Create your requirements document:"
|
|
116
126
|
echo " cp agent/design/requirements.template.md agent/design/requirements.md"
|
|
117
127
|
echo ""
|
|
@@ -123,7 +133,7 @@ echo " cp agent/progress.template.yaml agent/progress.yaml"
|
|
|
123
133
|
echo ""
|
|
124
134
|
echo "4. Read AGENT.md for complete documentation"
|
|
125
135
|
echo ""
|
|
126
|
-
echo
|
|
136
|
+
echo "${BLUE}ACP Commands Available:${NC}"
|
|
127
137
|
echo ""
|
|
128
138
|
echo " ${GREEN}@acp.init${NC} - Initialize agent context (start here!)"
|
|
129
139
|
echo " ${GREEN}@acp.proceed${NC} - Continue with next task"
|
|
@@ -137,6 +147,11 @@ echo " ${GREEN}@acp.version-check-for-updates${NC} - Check for ACP updates"
|
|
|
137
147
|
echo " ${GREEN}@acp.version-update${NC} - Update ACP to latest version"
|
|
138
148
|
echo " ${GREEN}@acp.package-install${NC} - Install third-party command packages"
|
|
139
149
|
echo ""
|
|
140
|
-
echo
|
|
150
|
+
echo "${BLUE}Git Commands Available:${NC}"
|
|
151
|
+
echo ""
|
|
152
|
+
echo " ${GREEN}@git.init${NC} - Initialize git repository with smart .gitignore"
|
|
153
|
+
echo " ${GREEN}@git.commit${NC} - Intelligent version-aware git commit"
|
|
154
|
+
echo ""
|
|
155
|
+
echo "${BLUE}For AI agents:${NC}"
|
|
141
156
|
echo "Type '${GREEN}@acp.init${NC}' to get started."
|
|
142
157
|
echo ""
|
package/agent/scripts/update.sh
CHANGED
|
@@ -5,24 +5,34 @@
|
|
|
5
5
|
|
|
6
6
|
set -e
|
|
7
7
|
|
|
8
|
-
# Colors for output
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
# Colors for output using tput (more reliable than ANSI codes)
|
|
9
|
+
if command -v tput >/dev/null 2>&1 && [ -t 1 ]; then
|
|
10
|
+
RED=$(tput setaf 1)
|
|
11
|
+
GREEN=$(tput setaf 2)
|
|
12
|
+
YELLOW=$(tput setaf 3)
|
|
13
|
+
BLUE=$(tput setaf 4)
|
|
14
|
+
BOLD=$(tput bold)
|
|
15
|
+
NC=$(tput sgr0)
|
|
16
|
+
else
|
|
17
|
+
RED=''
|
|
18
|
+
GREEN=''
|
|
19
|
+
YELLOW=''
|
|
20
|
+
BLUE=''
|
|
21
|
+
BOLD=''
|
|
22
|
+
NC=''
|
|
23
|
+
fi
|
|
14
24
|
|
|
15
25
|
# Repository details
|
|
16
26
|
REPO_URL="https://github.com/prmichaelsen/agent-context-protocol.git"
|
|
17
27
|
BRANCH="mainline"
|
|
18
28
|
|
|
19
|
-
echo
|
|
29
|
+
echo "${BLUE}Agent Context Protocol (ACP) Updater${NC}"
|
|
20
30
|
echo "======================================"
|
|
21
31
|
echo ""
|
|
22
32
|
|
|
23
33
|
# Check if AGENT.md exists
|
|
24
34
|
if [ ! -f "AGENT.md" ]; then
|
|
25
|
-
echo
|
|
35
|
+
echo "${RED}Error: AGENT.md not found in current directory${NC}"
|
|
26
36
|
echo "This script should be run from your project root where AGENT.md is located."
|
|
27
37
|
exit 1
|
|
28
38
|
fi
|
|
@@ -33,12 +43,12 @@ trap "rm -rf $TEMP_DIR" EXIT
|
|
|
33
43
|
|
|
34
44
|
echo "Fetching latest ACP files..."
|
|
35
45
|
if ! git clone --depth 1 --branch "$BRANCH" "$REPO_URL" "$TEMP_DIR" &>/dev/null; then
|
|
36
|
-
echo
|
|
46
|
+
echo "${RED}Error: Failed to fetch repository${NC}"
|
|
37
47
|
echo "Please check your internet connection and try again."
|
|
38
48
|
exit 1
|
|
39
49
|
fi
|
|
40
50
|
|
|
41
|
-
echo
|
|
51
|
+
echo "${GREEN}✓${NC} Latest files fetched"
|
|
42
52
|
echo ""
|
|
43
53
|
|
|
44
54
|
# Ensure reports directory exists and is ignored
|
|
@@ -52,7 +62,7 @@ if [ ! -f "agent/.gitignore" ]; then
|
|
|
52
62
|
# Reports directory - generated by @acp.report command
|
|
53
63
|
reports/
|
|
54
64
|
EOF
|
|
55
|
-
echo
|
|
65
|
+
echo "${GREEN}✓${NC} Created agent/.gitignore"
|
|
56
66
|
fi
|
|
57
67
|
|
|
58
68
|
echo "Updating ACP files..."
|
|
@@ -87,17 +97,17 @@ cp "$TEMP_DIR/agent/scripts/version.sh" "agent/scripts/"
|
|
|
87
97
|
cp "$TEMP_DIR/agent/scripts/install.sh" "agent/scripts/"
|
|
88
98
|
chmod +x agent/scripts/*.sh
|
|
89
99
|
|
|
90
|
-
echo
|
|
100
|
+
echo "${GREEN}✓${NC} All files updated"
|
|
91
101
|
echo ""
|
|
92
|
-
echo
|
|
102
|
+
echo "${GREEN}Update complete!${NC}"
|
|
93
103
|
echo ""
|
|
94
|
-
echo
|
|
104
|
+
echo "${BLUE}What was updated:${NC}"
|
|
95
105
|
echo " ✓ AGENT.md (methodology documentation)"
|
|
96
106
|
echo " ✓ Template files (design, milestone, task, pattern)"
|
|
97
107
|
echo " ✓ Command files (all ACP commands)"
|
|
98
108
|
echo " ✓ Utility scripts (update, check-for-updates, version, etc.)"
|
|
99
109
|
echo ""
|
|
100
|
-
echo
|
|
110
|
+
echo "${BLUE}Next steps:${NC}"
|
|
101
111
|
echo "1. Review changes: git diff"
|
|
102
112
|
echo "2. See what changed: git status"
|
|
103
113
|
echo "3. Revert if needed: git checkout <file>"
|
|
@@ -105,7 +115,7 @@ echo ""
|
|
|
105
115
|
echo "For detailed changelog:"
|
|
106
116
|
echo " https://github.com/prmichaelsen/agent-context-protocol/blob/mainline/CHANGELOG.md"
|
|
107
117
|
echo ""
|
|
108
|
-
echo
|
|
118
|
+
echo "${BLUE}ACP Commands Available:${NC}"
|
|
109
119
|
echo ""
|
|
110
120
|
echo " ${GREEN}@acp.init${NC} - Initialize agent context (run after update!)"
|
|
111
121
|
echo " ${GREEN}@acp.proceed${NC} - Continue with next task"
|
|
@@ -119,6 +129,11 @@ echo " ${GREEN}@acp.version-check-for-updates${NC} - Check for ACP updates"
|
|
|
119
129
|
echo " ${GREEN}@acp.version-update${NC} - Update ACP to latest version"
|
|
120
130
|
echo " ${GREEN}@acp.package-install${NC} - Install third-party command packages"
|
|
121
131
|
echo ""
|
|
122
|
-
echo
|
|
132
|
+
echo "${BLUE}Git Commands Available:${NC}"
|
|
133
|
+
echo ""
|
|
134
|
+
echo " ${GREEN}@git.init${NC} - Initialize git repository with smart .gitignore"
|
|
135
|
+
echo " ${GREEN}@git.commit${NC} - Intelligent version-aware git commit"
|
|
136
|
+
echo ""
|
|
137
|
+
echo "${BLUE}For AI agents:${NC}"
|
|
123
138
|
echo "Type '${GREEN}@acp.init${NC}' to reload context with updated files."
|
|
124
139
|
echo ""
|
|
@@ -1,230 +1,163 @@
|
|
|
1
|
-
# Task 45: Fix
|
|
1
|
+
# Task 45: Fix Publish False Success Bug
|
|
2
2
|
|
|
3
|
-
**Milestone**: M10 - Shared Spaces & Confirmation Flow
|
|
4
|
-
**Estimated Time**:
|
|
5
|
-
**Dependencies**:
|
|
3
|
+
**Milestone**: M10 - Shared Spaces & Confirmation Flow
|
|
4
|
+
**Estimated Time**: 1 hour
|
|
5
|
+
**Dependencies**: None
|
|
6
6
|
**Status**: Not Started
|
|
7
|
-
**Priority**:
|
|
7
|
+
**Priority**: CRITICAL
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
## Objective
|
|
12
12
|
|
|
13
|
-
Fix
|
|
13
|
+
Fix critical bug where `remember_publish` reports success even when Firestore request creation fails. The issue is a missing `return` statement in the error handler, causing the function to return `undefined` instead of an error response.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
## Problem Statement
|
|
18
18
|
|
|
19
|
-
###
|
|
20
|
-
- `remember_confirm` returns `success: true`
|
|
21
|
-
- Database shows `Memory_the_void` collection has 0 objects
|
|
22
|
-
- Memory only exists in personal collection (not copied)
|
|
23
|
-
- No error is thrown
|
|
24
|
-
- False positive misleads users and agents
|
|
19
|
+
### Observed Behavior
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
1. User calls `remember_publish`
|
|
22
|
+
2. Token service tries to create request in Firestore
|
|
23
|
+
3. Firestore operation fails (permissions, network, etc.)
|
|
24
|
+
4. Error is caught but NOT returned
|
|
25
|
+
5. Function returns `undefined`
|
|
26
|
+
6. MCP interprets `undefined` as success
|
|
27
|
+
7. User calls `remember_confirm` with token
|
|
28
|
+
8. Token validation fails (no request exists)
|
|
29
|
+
9. But user already thinks publish succeeded
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Steps
|
|
35
|
-
|
|
36
|
-
### 1. Verify Collection Exists
|
|
37
|
-
|
|
38
|
-
Check if `Memory_the_void` collection exists in Weaviate.
|
|
39
|
-
|
|
40
|
-
**Actions**:
|
|
41
|
-
- Query Weaviate for collection list
|
|
42
|
-
- Check if `Memory_the_void` exists
|
|
43
|
-
- Verify collection schema if it exists
|
|
44
|
-
- Check write permissions
|
|
45
|
-
|
|
46
|
-
**Expected Outcome**: Collection status determined
|
|
47
|
-
|
|
48
|
-
### 2. Review executePublishMemory Function
|
|
49
|
-
|
|
50
|
-
Examine the publish execution logic in confirm.ts.
|
|
51
|
-
|
|
52
|
-
**Actions**:
|
|
53
|
-
- Open [`src/tools/confirm.ts`](../../src/tools/confirm.ts)
|
|
54
|
-
- Review `executePublishMemory` function
|
|
55
|
-
- Check if `targetCollection.data.insert()` is called
|
|
56
|
-
- Verify result is returned correctly
|
|
57
|
-
- Check error handling
|
|
58
|
-
|
|
59
|
-
**Expected Outcome**: Code logic understood
|
|
60
|
-
|
|
61
|
-
### 3. Add Debug Logging
|
|
31
|
+
### Root Cause
|
|
62
32
|
|
|
63
|
-
|
|
33
|
+
**File**: `src/tools/publish.ts` line 203-210
|
|
64
34
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Run publish workflow with logging enabled.
|
|
77
|
-
|
|
78
|
-
**Actions**:
|
|
79
|
-
- Create test memory
|
|
80
|
-
- Call remember_publish
|
|
81
|
-
- Call remember_confirm with token
|
|
82
|
-
- Check logs for execution flow
|
|
83
|
-
- Verify if insert is called
|
|
84
|
-
- Check Weaviate for result
|
|
85
|
-
|
|
86
|
-
**Expected Outcome**: Root cause identified
|
|
87
|
-
|
|
88
|
-
### 5. Fix the Bug
|
|
89
|
-
|
|
90
|
-
Implement the fix based on root cause.
|
|
91
|
-
|
|
92
|
-
**Possible Fixes**:
|
|
93
|
-
- **If collection doesn't exist**: Ensure `ensureSpaceCollection()` creates it
|
|
94
|
-
- **If insert not called**: Fix logic flow to reach insert
|
|
95
|
-
- **If insert fails silently**: Add proper error handling
|
|
96
|
-
- **If permissions issue**: Fix Weaviate configuration
|
|
97
|
-
- **If wrong collection**: Fix collection name generation
|
|
98
|
-
|
|
99
|
-
**Expected Outcome**: Bug fixed
|
|
100
|
-
|
|
101
|
-
### 6. Verify Fix
|
|
35
|
+
```typescript
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return handleToolError(error, { // ✅ HAS return (fixed in v2.3.3)
|
|
38
|
+
toolName: 'remember_publish',
|
|
39
|
+
userId,
|
|
40
|
+
operation: 'publish memory',
|
|
41
|
+
memory_id: args.memory_id,
|
|
42
|
+
spaces: args.spaces,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
```
|
|
102
46
|
|
|
103
|
-
|
|
47
|
+
**Status**: Actually this WAS fixed in v2.3.3! Let me check if there are other places...
|
|
104
48
|
|
|
105
|
-
|
|
106
|
-
- Create test memory
|
|
107
|
-
- Publish to The Void
|
|
108
|
-
- Confirm publication
|
|
109
|
-
- Query `Memory_the_void` collection
|
|
110
|
-
- Verify memory exists in space
|
|
111
|
-
- Verify original memory unchanged
|
|
112
|
-
- Test search_space finds it
|
|
49
|
+
### Additional Investigation Needed
|
|
113
50
|
|
|
114
|
-
**
|
|
51
|
+
1. **Check if `addDocument` is failing silently**
|
|
52
|
+
- Add try-catch in `confirmationTokenService.createRequest`
|
|
53
|
+
- Log success/failure explicitly
|
|
54
|
+
- Return error if Firestore operation fails
|
|
115
55
|
|
|
116
|
-
|
|
56
|
+
2. **Check Firebase Admin SDK initialization**
|
|
57
|
+
- Verify service account has Firestore permissions
|
|
58
|
+
- Check if initialization succeeds
|
|
59
|
+
- Log initialization status
|
|
117
60
|
|
|
118
|
-
|
|
61
|
+
3. **Check Firestore collection creation**
|
|
62
|
+
- Verify `users/{userId}/requests` collection can be created
|
|
63
|
+
- Check if parent document `users/{userId}` needs to exist first
|
|
64
|
+
- Test with actual Firebase project
|
|
119
65
|
|
|
120
|
-
|
|
121
|
-
- Create integration test file
|
|
122
|
-
- Test: create → publish → confirm → verify in space
|
|
123
|
-
- Test: search_space finds published memory
|
|
124
|
-
- Test: original memory still in personal collection
|
|
125
|
-
- Requires live Weaviate instance
|
|
66
|
+
---
|
|
126
67
|
|
|
127
|
-
|
|
68
|
+
## Solution
|
|
128
69
|
|
|
129
|
-
###
|
|
70
|
+
### Step 1: Add Error Handling in Token Service
|
|
130
71
|
|
|
131
|
-
|
|
72
|
+
**File**: `src/services/confirmation-token.service.ts`
|
|
132
73
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
74
|
+
```typescript
|
|
75
|
+
async createRequest(
|
|
76
|
+
userId: string,
|
|
77
|
+
action: string,
|
|
78
|
+
payload: any,
|
|
79
|
+
targetCollection?: string
|
|
80
|
+
): Promise<{ requestId: string; token: string }> {
|
|
81
|
+
try {
|
|
82
|
+
const token = randomUUID();
|
|
83
|
+
// ... create request object
|
|
84
|
+
|
|
85
|
+
console.log('[ConfirmationTokenService] Attempting to create request in Firestore');
|
|
86
|
+
|
|
87
|
+
const docRef = await addDocument(collectionPath, request);
|
|
88
|
+
|
|
89
|
+
if (!docRef || !docRef.id) {
|
|
90
|
+
throw new Error('Failed to create Firestore document - no document ID returned');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
console.log('[ConfirmationTokenService] Request created successfully:', {
|
|
94
|
+
requestId: docRef.id,
|
|
95
|
+
token,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
return { requestId: docRef.id, token };
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.error('[ConfirmationTokenService] Failed to create request:', error);
|
|
101
|
+
console.error('[ConfirmationTokenService] Context:', {
|
|
102
|
+
userId,
|
|
103
|
+
action,
|
|
104
|
+
collectionPath: `users/${userId}/requests`,
|
|
105
|
+
});
|
|
106
|
+
throw error; // Re-throw so caller can handle
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
138
110
|
|
|
139
|
-
|
|
111
|
+
### Step 2: Verify Error Propagation
|
|
140
112
|
|
|
141
|
-
|
|
113
|
+
Ensure errors from token service propagate to tool handler:
|
|
142
114
|
|
|
143
|
-
|
|
115
|
+
**File**: `src/tools/publish.ts`
|
|
144
116
|
|
|
145
|
-
|
|
146
|
-
- Test with large memory
|
|
147
|
-
- Test with memory that has relationships
|
|
148
|
-
- Test with memory that has special characters
|
|
149
|
-
- Test concurrent publishes
|
|
150
|
-
- Test expired token
|
|
117
|
+
The error handler already has `return` (fixed in v2.3.3), so errors should propagate correctly.
|
|
151
118
|
|
|
152
|
-
|
|
119
|
+
### Step 3: Check Firebase Permissions
|
|
153
120
|
|
|
154
|
-
|
|
121
|
+
**Use Firebase MCP tools**:
|
|
122
|
+
```typescript
|
|
123
|
+
// Check if service account has correct permissions
|
|
124
|
+
// Verify Firestore database exists
|
|
125
|
+
// Test write operation
|
|
126
|
+
```
|
|
155
127
|
|
|
156
|
-
|
|
128
|
+
### Step 4: Add Integration Test
|
|
157
129
|
|
|
158
|
-
**
|
|
159
|
-
- Add to CHANGELOG (patch version)
|
|
160
|
-
- Update any affected documentation
|
|
161
|
-
- Note in progress.yaml
|
|
162
|
-
- Document root cause for future reference
|
|
130
|
+
**File**: `tests/integration/publish-flow.test.ts`
|
|
163
131
|
|
|
164
|
-
|
|
132
|
+
Test the full flow:
|
|
133
|
+
1. Create request (should succeed or fail clearly)
|
|
134
|
+
2. Verify request exists in Firestore
|
|
135
|
+
3. Confirm request
|
|
136
|
+
4. Verify memory published
|
|
165
137
|
|
|
166
138
|
---
|
|
167
139
|
|
|
168
140
|
## Verification
|
|
169
141
|
|
|
170
|
-
- [ ]
|
|
171
|
-
- [ ]
|
|
172
|
-
- [ ]
|
|
173
|
-
- [ ]
|
|
174
|
-
- [ ]
|
|
175
|
-
- [ ]
|
|
176
|
-
- [ ]
|
|
177
|
-
- [ ] All tests passing
|
|
178
|
-
- [ ] TypeScript compiles
|
|
179
|
-
- [ ] Build successful
|
|
180
|
-
- [ ] Changes committed and pushed
|
|
142
|
+
- [ ] `addDocument` errors are caught and logged
|
|
143
|
+
- [ ] Errors propagate from token service to tool handler
|
|
144
|
+
- [ ] Tool returns error response (not undefined)
|
|
145
|
+
- [ ] Firebase credentials verified
|
|
146
|
+
- [ ] Service account has Firestore write permissions
|
|
147
|
+
- [ ] Integration test passes
|
|
148
|
+
- [ ] Production logs show clear error messages
|
|
181
149
|
|
|
182
150
|
---
|
|
183
151
|
|
|
184
|
-
##
|
|
185
|
-
|
|
186
|
-
- [ ] Check if `Memory_the_void` collection exists
|
|
187
|
-
- [ ] Verify `ensureSpaceCollection()` is called
|
|
188
|
-
- [ ] Verify `targetCollection.data.insert()` is called
|
|
189
|
-
- [ ] Check if insert returns a result
|
|
190
|
-
- [ ] Verify result is used in response
|
|
191
|
-
- [ ] Check server logs for errors
|
|
192
|
-
- [ ] Test with actual Weaviate instance
|
|
193
|
-
- [ ] Verify Weaviate write permissions
|
|
194
|
-
|
|
195
|
-
---
|
|
152
|
+
## Files Modified
|
|
196
153
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
The bug is likely in [`src/tools/confirm.ts`](../../src/tools/confirm.ts) in the `executePublishMemory` function. The insert operation may not be executing or may be failing silently.
|
|
200
|
-
|
|
201
|
-
**Likely Issue**: Missing await, incorrect API usage, or silent error
|
|
202
|
-
|
|
203
|
-
**Expected Code**:
|
|
204
|
-
```typescript
|
|
205
|
-
const result = await targetCollection.data.insert({
|
|
206
|
-
properties: publishedMemory as any,
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
// Verify result
|
|
210
|
-
if (!result) {
|
|
211
|
-
throw new Error('Failed to insert memory into space collection');
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return JSON.stringify({
|
|
215
|
-
success: true,
|
|
216
|
-
space_memory_id: result,
|
|
217
|
-
}, null, 2);
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
---
|
|
154
|
+
- `src/services/confirmation-token.service.ts` - Add error handling
|
|
155
|
+
- `src/tools/publish.ts` - Verify error propagation (already fixed)
|
|
221
156
|
|
|
222
|
-
##
|
|
157
|
+
## Files Created
|
|
223
158
|
|
|
224
|
-
-
|
|
225
|
-
- Space Schema: [`src/weaviate/space-schema.ts`](../../src/weaviate/space-schema.ts)
|
|
226
|
-
- Design: [`agent/design/publish-tools-confirmation-flow.md`](../design/publish-tools-confirmation-flow.md)
|
|
159
|
+
- `tests/integration/publish-flow.test.ts` - Integration test (optional)
|
|
227
160
|
|
|
228
161
|
---
|
|
229
162
|
|
|
230
|
-
**Next Task**: Investigate
|
|
163
|
+
**Next Task**: Investigate production logs to confirm root cause
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Task 46: Update SpaceMemory Types for Multi-Space
|
|
2
|
+
|
|
3
|
+
**Milestone**: M11 - Unified Public Collection
|
|
4
|
+
**Estimated Time**: 1 hour
|
|
5
|
+
**Dependencies**: None
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
Update the `SpaceMemory` interface to use `spaces: string[]` instead of `space_id: string`, enabling memories to belong to multiple spaces simultaneously.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
### 1. Update SpaceMemory Interface
|
|
19
|
+
|
|
20
|
+
**File**: `src/types/space-memory.ts`
|
|
21
|
+
|
|
22
|
+
**Changes**:
|
|
23
|
+
```typescript
|
|
24
|
+
// Before
|
|
25
|
+
export interface SpaceMemory extends Omit<Memory, 'user_id' | 'doc_type'> {
|
|
26
|
+
space_id: string; // ❌ Single space
|
|
27
|
+
author_id: string;
|
|
28
|
+
// ...
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// After
|
|
32
|
+
export interface SpaceMemory extends Omit<Memory, 'user_id' | 'doc_type'> {
|
|
33
|
+
spaces: string[]; // ✅ Multiple spaces!
|
|
34
|
+
author_id: string;
|
|
35
|
+
// ...
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Update Type Exports
|
|
40
|
+
|
|
41
|
+
**File**: `src/types/space-memory.ts`
|
|
42
|
+
|
|
43
|
+
- Update `SpaceSearchOptions` if needed
|
|
44
|
+
- Update `SpaceSearchResult` if needed
|
|
45
|
+
- Keep `SpaceId` type and `SUPPORTED_SPACES` constant
|
|
46
|
+
|
|
47
|
+
### 3. Add Backward Compatibility (Optional)
|
|
48
|
+
|
|
49
|
+
Consider adding a migration helper:
|
|
50
|
+
```typescript
|
|
51
|
+
export function migrateSpaceMemory(old: any): SpaceMemory {
|
|
52
|
+
if (old.space_id && !old.spaces) {
|
|
53
|
+
return {
|
|
54
|
+
...old,
|
|
55
|
+
spaces: [old.space_id],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return old;
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 4. Update Type Tests
|
|
63
|
+
|
|
64
|
+
**File**: Create `src/types/space-memory.spec.ts` if needed
|
|
65
|
+
|
|
66
|
+
Test that:
|
|
67
|
+
- SpaceMemory interface has `spaces` array
|
|
68
|
+
- Type checking works correctly
|
|
69
|
+
- Migration helper works (if implemented)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Verification
|
|
74
|
+
|
|
75
|
+
- [ ] `SpaceMemory` interface uses `spaces: string[]`
|
|
76
|
+
- [ ] No `space_id` field in interface
|
|
77
|
+
- [ ] Type exports updated
|
|
78
|
+
- [ ] TypeScript compiles without errors
|
|
79
|
+
- [ ] No breaking changes to existing code (yet)
|
|
80
|
+
- [ ] Documentation comments updated
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Files Modified
|
|
85
|
+
|
|
86
|
+
- `src/types/space-memory.ts` - Update interface
|
|
87
|
+
|
|
88
|
+
## Files Created
|
|
89
|
+
|
|
90
|
+
- `src/types/space-memory.spec.ts` - Type tests (optional)
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
**Next Task**: Task 47 - Update Space Schema with Spaces Array
|