mcp-quickbase 2.1.0 → 2.2.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.
- package/.sdd/tickets/RELS_relationship-management/README.md +98 -0
- package/.sdd/tickets/RELS_relationship-management/planning/analysis.md +190 -0
- package/.sdd/tickets/RELS_relationship-management/planning/architecture.md +413 -0
- package/.sdd/tickets/RELS_relationship-management/planning/plan.md +177 -0
- package/.sdd/tickets/RELS_relationship-management/planning/quality-strategy.md +335 -0
- package/.sdd/tickets/RELS_relationship-management/planning/review-updates.md +95 -0
- package/.sdd/tickets/RELS_relationship-management/planning/security-review.md +213 -0
- package/.sdd/tickets/RELS_relationship-management/planning/ticket-review.md +885 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1001_domain-setup.md +96 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1002_get-relationships-tool.md +142 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1003_register-phase1-tools.md +105 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2001_create-relationship-tool.md +151 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2002_update-relationship-tool.md +145 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.3001_delete-relationship-tool.md +154 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4001_integration-testing.md +159 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4002_final-verification.md +182 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS_TASK_INDEX.md +179 -0
- package/dist/tools/apps/list_tables.d.ts +5 -5
- package/dist/tools/apps/list_tables.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +4 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/relationships/create_relationship.d.ts +150 -0
- package/dist/tools/relationships/create_relationship.js +181 -0
- package/dist/tools/relationships/create_relationship.js.map +1 -0
- package/dist/tools/relationships/delete_relationship.d.ts +66 -0
- package/dist/tools/relationships/delete_relationship.js +85 -0
- package/dist/tools/relationships/delete_relationship.js.map +1 -0
- package/dist/tools/relationships/get_relationships.d.ts +126 -0
- package/dist/tools/relationships/get_relationships.js +126 -0
- package/dist/tools/relationships/get_relationships.js.map +1 -0
- package/dist/tools/relationships/index.d.ts +14 -0
- package/dist/tools/relationships/index.js +37 -0
- package/dist/tools/relationships/index.js.map +1 -0
- package/dist/tools/relationships/update_relationship.d.ts +139 -0
- package/dist/tools/relationships/update_relationship.js +168 -0
- package/dist/tools/relationships/update_relationship.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Task: [RELS.3001]: Implement DeleteRelationshipTool with Safety Warnings
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
- [x] **Task completed** - acceptance criteria met
|
|
5
|
+
- [x] **Tests pass** - tests executed and passing (or N/A if no tests)
|
|
6
|
+
- [x] **Verified** - by the verify-task agent
|
|
7
|
+
|
|
8
|
+
**Note on "Tests pass"**:
|
|
9
|
+
- If tests were created/modified, you MUST run them and show output
|
|
10
|
+
- "Tests pass" means tests were EXECUTED and all passed
|
|
11
|
+
- "Tests pass - N/A" is only valid for documentation-only tickets
|
|
12
|
+
- Test file existence alone does NOT satisfy this requirement
|
|
13
|
+
|
|
14
|
+
## Agents
|
|
15
|
+
- implement-feature
|
|
16
|
+
- unit-test-runner
|
|
17
|
+
- verify-task
|
|
18
|
+
- commit-task
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Implement the `delete_relationship` tool with comprehensive safety warnings and agent guidance to prevent unintended data loss.
|
|
22
|
+
|
|
23
|
+
## Background
|
|
24
|
+
This is a DESTRUCTIVE operation that permanently deletes relationships and all associated lookup/summary fields. The tool description must start with "WARNING: DESTRUCTIVE OPERATION" and explicitly list what will be deleted, what data will be lost, and recommend user confirmation before proceeding.
|
|
25
|
+
|
|
26
|
+
This implements Phase 3 from plan.md: Destructive Operations with Safety Measures.
|
|
27
|
+
|
|
28
|
+
## Acceptance Criteria
|
|
29
|
+
- [x] Tool name is `delete_relationship` (snake_case)
|
|
30
|
+
- [x] Tool description starts with "WARNING: DESTRUCTIVE OPERATION"
|
|
31
|
+
- [x] Description explicitly lists what will be deleted (lookup fields, summary fields)
|
|
32
|
+
- [x] Description explicitly states data is permanently lost
|
|
33
|
+
- [x] Description recommends using get_relationships first to review impact
|
|
34
|
+
- [x] Description recommends confirming with user before proceeding
|
|
35
|
+
- [x] Tool extends BaseTool with proper TypeScript types
|
|
36
|
+
- [x] Successfully deletes relationships via API
|
|
37
|
+
- [x] Returns confirmation with relationship ID
|
|
38
|
+
- [x] Tool registered in relationships/index.ts
|
|
39
|
+
- [x] Unit tests cover: successful deletion, relationship not found, API errors
|
|
40
|
+
- [x] All tests pass with `npm test`
|
|
41
|
+
|
|
42
|
+
## Technical Requirements
|
|
43
|
+
- Endpoint: DELETE `/tables/{tableId}/relationships/{relationshipId}`
|
|
44
|
+
- Simple parameters: table_id and relationship_id
|
|
45
|
+
- Return confirmation of deletion with relationship ID
|
|
46
|
+
- Clear error messages for failures
|
|
47
|
+
- No actual data validation needed (API handles it)
|
|
48
|
+
|
|
49
|
+
## Implementation Notes
|
|
50
|
+
From architecture.md:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
interface DeleteRelationshipParams {
|
|
54
|
+
table_id: string; // Required: Child table ID
|
|
55
|
+
relationship_id: number; // Required: Relationship ID to delete
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface DeleteRelationshipResult {
|
|
59
|
+
relationshipId: number;
|
|
60
|
+
deleted: boolean;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Tool description (CRITICAL - from architecture.md):
|
|
65
|
+
```
|
|
66
|
+
WARNING: DESTRUCTIVE OPERATION - Permanently deletes an entire table-to-table
|
|
67
|
+
relationship INCLUDING ALL LOOKUP AND SUMMARY FIELDS associated with it. All data
|
|
68
|
+
in those fields will be permanently lost and CANNOT be recovered. The reference
|
|
69
|
+
field in the child table will NOT be deleted (it will remain and may need to be
|
|
70
|
+
manually deleted using field deletion tools if no longer needed). Before using
|
|
71
|
+
this tool:
|
|
72
|
+
1. Use get_relationships to see what fields will be deleted
|
|
73
|
+
2. Confirm with the user that they want to proceed
|
|
74
|
+
3. Consider if you only need to delete specific fields instead
|
|
75
|
+
|
|
76
|
+
Only use this tool when you are certain the entire relationship should be removed.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Implementation pattern:
|
|
80
|
+
```typescript
|
|
81
|
+
const logger = createLogger('DeleteRelationshipTool');
|
|
82
|
+
logger.warn('Deleting relationship', { tableId, relationshipId });
|
|
83
|
+
|
|
84
|
+
const response = await this.client.request({
|
|
85
|
+
method: 'DELETE',
|
|
86
|
+
path: `/tables/${tableId}/relationships/${relationshipId}`
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
relationshipId: params.relationship_id,
|
|
91
|
+
deleted: true
|
|
92
|
+
};
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Dependencies
|
|
96
|
+
- RELS.1001 - Domain setup complete
|
|
97
|
+
- RELS.1002 - GetRelationshipsTool (referenced in safety instructions)
|
|
98
|
+
- RELS.2001, RELS.2002 - Create/Update tools provide patterns
|
|
99
|
+
|
|
100
|
+
## Risk Assessment
|
|
101
|
+
- **Risk**: Agent uses delete without understanding consequences
|
|
102
|
+
- **Mitigation**: Comprehensive warning in tool description; recommend user confirmation
|
|
103
|
+
- **Risk**: Agent doesn't check what will be deleted first
|
|
104
|
+
- **Mitigation**: Description explicitly recommends using get_relationships first
|
|
105
|
+
- **Risk**: Agent deletes wrong relationship
|
|
106
|
+
- **Mitigation**: Require relationship_id parameter; include clear error messages
|
|
107
|
+
|
|
108
|
+
## Files/Packages Affected
|
|
109
|
+
- src/tools/relationships/delete_relationship.ts (new file)
|
|
110
|
+
- src/tools/relationships/index.ts (update exports and registration)
|
|
111
|
+
- src/__tests__/tools/relationships.test.ts (extend tests)
|
|
112
|
+
|
|
113
|
+
## Deliverables Produced
|
|
114
|
+
|
|
115
|
+
Documents created in `deliverables/` directory:
|
|
116
|
+
|
|
117
|
+
- None
|
|
118
|
+
|
|
119
|
+
## Verification Notes
|
|
120
|
+
Verify-task agent MUST confirm tool description safety from quality-strategy.md:
|
|
121
|
+
|
|
122
|
+
CRITICAL - Safety Verification:
|
|
123
|
+
- [x] Tool description contains "WARNING"
|
|
124
|
+
- [x] Tool description contains "DESTRUCTIVE"
|
|
125
|
+
- [x] Tool description mentions lookup fields deletion
|
|
126
|
+
- [x] Tool description mentions summary fields deletion
|
|
127
|
+
- [x] Tool description mentions data loss is permanent
|
|
128
|
+
- [x] Tool description recommends get_relationships first
|
|
129
|
+
- [x] Tool description recommends user confirmation
|
|
130
|
+
|
|
131
|
+
Test Coverage (from quality-strategy.md):
|
|
132
|
+
Happy Path:
|
|
133
|
+
- Successful deletion returns relationship ID
|
|
134
|
+
- deleted: true in result
|
|
135
|
+
|
|
136
|
+
Error Cases:
|
|
137
|
+
- Relationship not found (404)
|
|
138
|
+
- Unauthorized (401)
|
|
139
|
+
- Forbidden (403)
|
|
140
|
+
|
|
141
|
+
Edge Cases:
|
|
142
|
+
- Deleting relationship with many lookup/summary fields
|
|
143
|
+
- API error messages preserved in response
|
|
144
|
+
|
|
145
|
+
Additional Verification:
|
|
146
|
+
- Use logger.warn() for deletion operations (not logger.info())
|
|
147
|
+
- Error messages include context (table ID, relationship ID)
|
|
148
|
+
- Result structure matches DeleteRelationshipResult interface
|
|
149
|
+
|
|
150
|
+
## Verification Audit
|
|
151
|
+
<!-- Audit log maintained by verify-task agent for enterprise compliance -->
|
|
152
|
+
| Date | Agent | Decision | Notes |
|
|
153
|
+
|------|-------|----------|-------|
|
|
154
|
+
| 2025-12-28 | verify-task | PASS | All 12 acceptance criteria met, all 7 safety warnings verified, 229/229 tests passing, 100% line coverage on delete_relationship.ts |
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Task: [RELS.4001]: Integration Testing and Coverage Verification
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
- [x] **Task completed** - acceptance criteria met
|
|
5
|
+
- [x] **Tests pass** - tests executed and passing (or N/A if no tests)
|
|
6
|
+
- [x] **Verified** - by the verify-task agent
|
|
7
|
+
|
|
8
|
+
**Note on "Tests pass"**:
|
|
9
|
+
- If tests were created/modified, you MUST run them and show output
|
|
10
|
+
- "Tests pass" means tests were EXECUTED and all passed
|
|
11
|
+
- "Tests pass - N/A" is only valid for documentation-only tickets
|
|
12
|
+
- Test file existence alone does NOT satisfy this requirement
|
|
13
|
+
|
|
14
|
+
## Agents
|
|
15
|
+
- verify-task
|
|
16
|
+
- unit-test-runner
|
|
17
|
+
- commit-task
|
|
18
|
+
|
|
19
|
+
## Summary
|
|
20
|
+
Run comprehensive integration tests to verify all relationship tools are properly registered, execute correctly, and meet coverage thresholds defined in jest.config.js.
|
|
21
|
+
|
|
22
|
+
## Background
|
|
23
|
+
This is the final verification phase that confirms all four relationship tools are integrated correctly, the test suite passes, coverage meets thresholds, and all quality gates are satisfied.
|
|
24
|
+
|
|
25
|
+
This implements Phase 4 from plan.md: Integration and Verification.
|
|
26
|
+
|
|
27
|
+
## Acceptance Criteria
|
|
28
|
+
- [x] `npm test` passes all tests with no failures
|
|
29
|
+
- [x] Test coverage meets jest.config.js thresholds: >= 40% lines/functions/statements, >= 20% branches
|
|
30
|
+
- [x] All four relationship tools registered in toolRegistry
|
|
31
|
+
- [x] Integration tests confirm tools are callable through MCP interface
|
|
32
|
+
- [x] Tool descriptions verified for clarity and safety warnings
|
|
33
|
+
- [x] No TypeScript compilation errors (`npm run build`)
|
|
34
|
+
- [x] No linting errors (`npm run lint`)
|
|
35
|
+
|
|
36
|
+
## Technical Requirements
|
|
37
|
+
- Run full test suite: `npm test`
|
|
38
|
+
- Run with coverage: `npm test -- --coverage`
|
|
39
|
+
- Verify coverage thresholds (from jest.config.js):
|
|
40
|
+
- Lines: 40%
|
|
41
|
+
- Functions: 40%
|
|
42
|
+
- Statements: 40%
|
|
43
|
+
- Branches: 20%
|
|
44
|
+
- Check tool registration via toolRegistry.getAllTools()
|
|
45
|
+
- Verify each tool can be retrieved by name
|
|
46
|
+
- Confirm tool descriptions contain required elements
|
|
47
|
+
|
|
48
|
+
## Implementation Notes
|
|
49
|
+
From quality-strategy.md, integration tests should verify:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// All tools appear in registry
|
|
53
|
+
const allTools = toolRegistry.getAllTools();
|
|
54
|
+
expect(allTools).toContainEqual(expect.objectContaining({ name: 'get_relationships' }));
|
|
55
|
+
expect(allTools).toContainEqual(expect.objectContaining({ name: 'create_relationship' }));
|
|
56
|
+
expect(allTools).toContainEqual(expect.objectContaining({ name: 'update_relationship' }));
|
|
57
|
+
expect(allTools).toContainEqual(expect.objectContaining({ name: 'delete_relationship' }));
|
|
58
|
+
|
|
59
|
+
// Tools can be retrieved by name
|
|
60
|
+
const getTool = toolRegistry.getTool('get_relationships');
|
|
61
|
+
expect(getTool).toBeDefined();
|
|
62
|
+
expect(getTool.name).toBe('get_relationships');
|
|
63
|
+
|
|
64
|
+
// Execute returns proper ApiResponse structure
|
|
65
|
+
const result = await getTool.execute({ table_id: 'test' });
|
|
66
|
+
expect(result).toHaveProperty('success');
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Verify delete tool description contains (from plan.md):
|
|
70
|
+
- "WARNING: DESTRUCTIVE OPERATION"
|
|
71
|
+
- Mentions lookup/summary field deletion
|
|
72
|
+
- States data is permanent
|
|
73
|
+
- Recommends get_relationships first
|
|
74
|
+
- Recommends user confirmation
|
|
75
|
+
|
|
76
|
+
## Dependencies
|
|
77
|
+
- RELS.1001 - Domain setup
|
|
78
|
+
- RELS.1002 - GetRelationshipsTool
|
|
79
|
+
- RELS.1003 - Tool registration
|
|
80
|
+
- RELS.2001 - CreateRelationshipTool
|
|
81
|
+
- RELS.2002 - UpdateRelationshipTool
|
|
82
|
+
- RELS.3001 - DeleteRelationshipTool
|
|
83
|
+
|
|
84
|
+
All implementation tasks must be complete before integration testing.
|
|
85
|
+
|
|
86
|
+
## Risk Assessment
|
|
87
|
+
- **Risk**: Coverage falls below threshold
|
|
88
|
+
- **Mitigation**: Review uncovered code; add targeted tests for critical paths
|
|
89
|
+
- **Risk**: Tool not appearing in registry
|
|
90
|
+
- **Mitigation**: Check registration function was called; verify exports
|
|
91
|
+
- **Risk**: Integration test failures
|
|
92
|
+
- **Mitigation**: Debug specific tool; check mocking setup
|
|
93
|
+
|
|
94
|
+
## Files/Packages Affected
|
|
95
|
+
- src/__tests__/tools/relationships.test.ts (integration test section)
|
|
96
|
+
- All relationship tool files (verification only)
|
|
97
|
+
- src/tools/index.ts (verification only)
|
|
98
|
+
- src/tools/relationships/index.ts (verification only)
|
|
99
|
+
|
|
100
|
+
## Deliverables Produced
|
|
101
|
+
|
|
102
|
+
Documents created in `deliverables/` directory:
|
|
103
|
+
|
|
104
|
+
- None
|
|
105
|
+
|
|
106
|
+
## Verification Notes
|
|
107
|
+
Verify-task agent should run and confirm:
|
|
108
|
+
|
|
109
|
+
1. **Test Execution**:
|
|
110
|
+
```bash
|
|
111
|
+
npm test
|
|
112
|
+
# All tests should pass
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
2. **Coverage Report**:
|
|
116
|
+
```bash
|
|
117
|
+
npm test -- --coverage
|
|
118
|
+
# Verify coverage meets thresholds:
|
|
119
|
+
# - Lines: >= 40%
|
|
120
|
+
# - Functions: >= 40%
|
|
121
|
+
# - Statements: >= 40%
|
|
122
|
+
# - Branches: >= 20%
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
3. **Build Verification**:
|
|
126
|
+
```bash
|
|
127
|
+
npm run build
|
|
128
|
+
# Should complete without TypeScript errors
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
4. **Linting Verification**:
|
|
132
|
+
```bash
|
|
133
|
+
npm run lint
|
|
134
|
+
# Should show no errors
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
5. **Tool Registration**:
|
|
138
|
+
- Verify all 4 tools in toolRegistry.getAllTools()
|
|
139
|
+
- Verify each tool can be retrieved by name
|
|
140
|
+
- Verify tool descriptions are non-empty
|
|
141
|
+
|
|
142
|
+
6. **Safety Verification** (CRITICAL):
|
|
143
|
+
- DeleteRelationshipTool description contains all required warnings
|
|
144
|
+
- See RELS.3001 verification notes for complete checklist
|
|
145
|
+
|
|
146
|
+
Quality gates from quality-strategy.md:
|
|
147
|
+
- [x] All unit tests pass
|
|
148
|
+
- [x] Coverage thresholds met (40% lines/functions/statements, 20% branches)
|
|
149
|
+
- [x] No linting errors
|
|
150
|
+
- [x] No TypeScript errors
|
|
151
|
+
- [x] All four tools registered
|
|
152
|
+
- [x] Delete tool description contains safety warnings
|
|
153
|
+
- [x] All critical paths tested (see quality-strategy.md sections)
|
|
154
|
+
|
|
155
|
+
## Verification Audit
|
|
156
|
+
<!-- Audit log maintained by verify-task agent for enterprise compliance -->
|
|
157
|
+
| Date | Agent | Decision | Notes |
|
|
158
|
+
|------|-------|----------|-------|
|
|
159
|
+
| 2025-12-28 | verify-task | PASS | 229/229 tests passing, coverage: 52.97% lines/54.63% functions/52.68% statements/38.31% branches (all exceed thresholds), build successful, lint 0 errors, all 4 relationship tools registered (24 total) |
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Task: [RELS.4002]: Final Verification and Documentation Review
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
- [x] **Task completed** - acceptance criteria met
|
|
5
|
+
- [x] **Tests pass** - tests executed and passing (or N/A if no tests)
|
|
6
|
+
- [x] **Verified** - by the verify-task agent
|
|
7
|
+
|
|
8
|
+
**Note on "Tests pass"**:
|
|
9
|
+
- If tests were created/modified, you MUST run them and show output
|
|
10
|
+
- "Tests pass" means tests were EXECUTED and all passed
|
|
11
|
+
- "Tests pass - N/A" is only valid for documentation-only tickets
|
|
12
|
+
- Test file existence alone does NOT satisfy this requirement
|
|
13
|
+
|
|
14
|
+
## Agents
|
|
15
|
+
- verify-task
|
|
16
|
+
- commit-task
|
|
17
|
+
|
|
18
|
+
## Summary
|
|
19
|
+
Perform final verification of all relationship tools, review tool descriptions for agent clarity, and confirm all success metrics from plan.md are met.
|
|
20
|
+
|
|
21
|
+
## Background
|
|
22
|
+
This is the final quality gate before committing the relationship management feature. It ensures all tools work correctly, descriptions help agents understand when to use each tool, and destructive operations are clearly marked.
|
|
23
|
+
|
|
24
|
+
This completes Phase 4 from plan.md: Integration and Verification.
|
|
25
|
+
|
|
26
|
+
## Acceptance Criteria
|
|
27
|
+
- [x] All four relationship tools functional and registered
|
|
28
|
+
- [x] Tool descriptions help agents understand when to use each tool
|
|
29
|
+
- [x] Destructive operations clearly marked with consequences
|
|
30
|
+
- [x] get_relationships returns accurate relationship data
|
|
31
|
+
- [x] create_relationship successfully creates relationships with lookup/summary fields
|
|
32
|
+
- [x] update_relationship adds fields without deleting existing ones
|
|
33
|
+
- [x] delete_relationship has prominent destructive operation warnings
|
|
34
|
+
- [x] All success metrics from plan.md verified
|
|
35
|
+
- [x] All quality gates from quality-strategy.md passed
|
|
36
|
+
|
|
37
|
+
## Technical Requirements
|
|
38
|
+
- Verify all tools against plan.md success metrics
|
|
39
|
+
- Review tool descriptions for clarity and completeness
|
|
40
|
+
- Confirm safety warnings in delete tool
|
|
41
|
+
- Verify parameter naming follows snake_case convention
|
|
42
|
+
- Confirm error messages include context for debugging
|
|
43
|
+
- Review logging patterns (info for reads, warn for deletes)
|
|
44
|
+
|
|
45
|
+
## Implementation Notes
|
|
46
|
+
Success metrics from plan.md to verify:
|
|
47
|
+
|
|
48
|
+
- [x] All four relationship tools implemented and registered
|
|
49
|
+
- [x] get_relationships returns accurate relationship data
|
|
50
|
+
- [x] create_relationship successfully creates relationships with lookup/summary fields
|
|
51
|
+
- [x] update_relationship adds fields without deleting existing ones
|
|
52
|
+
- [x] delete_relationship has prominent destructive operation warnings
|
|
53
|
+
- [x] Test coverage >= 40% lines/functions/statements, >= 20% branches
|
|
54
|
+
- [x] No lint errors
|
|
55
|
+
- [x] Tool descriptions help agents understand when to use each tool
|
|
56
|
+
- [x] Destructive operations clearly marked and explain consequences
|
|
57
|
+
|
|
58
|
+
Review each tool description:
|
|
59
|
+
|
|
60
|
+
1. **get_relationships**: Should explain it's for exploration before modifications
|
|
61
|
+
2. **create_relationship**: Should emphasize SAFE operation
|
|
62
|
+
3. **update_relationship**: Should clearly state ADDITIVE ONLY
|
|
63
|
+
4. **delete_relationship**: Should have WARNING and list consequences
|
|
64
|
+
|
|
65
|
+
Parameter naming verification (from plan.md):
|
|
66
|
+
- table_id (not tableId)
|
|
67
|
+
- relationship_id (not relationshipId)
|
|
68
|
+
- parent_table_id (not parentTableId)
|
|
69
|
+
- lookup_field_ids (not lookupFieldIds)
|
|
70
|
+
|
|
71
|
+
Error message format verification (from plan.md):
|
|
72
|
+
```typescript
|
|
73
|
+
// Should include context
|
|
74
|
+
throw new Error(`Failed to get relationships for table ${tableId}: ${response.error?.message || 'Unknown error'}`);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Dependencies
|
|
78
|
+
- RELS.4001 - Integration testing complete
|
|
79
|
+
- All implementation tasks (RELS.1001-RELS.3001) complete
|
|
80
|
+
|
|
81
|
+
## Risk Assessment
|
|
82
|
+
- **Risk**: Tool descriptions unclear to agents
|
|
83
|
+
- **Mitigation**: Review descriptions from agent perspective; test with sample queries
|
|
84
|
+
- **Risk**: Missing safety warnings
|
|
85
|
+
- **Mitigation**: Use checklist from RELS.3001 verification notes
|
|
86
|
+
- **Risk**: Inconsistent naming conventions
|
|
87
|
+
- **Mitigation**: Check all parameter names against plan.md conventions
|
|
88
|
+
|
|
89
|
+
## Files/Packages Affected
|
|
90
|
+
- src/tools/relationships/get_relationships.ts (review only)
|
|
91
|
+
- src/tools/relationships/create_relationship.ts (review only)
|
|
92
|
+
- src/tools/relationships/update_relationship.ts (review only)
|
|
93
|
+
- src/tools/relationships/delete_relationship.ts (review only)
|
|
94
|
+
- All test files (review coverage)
|
|
95
|
+
|
|
96
|
+
## Deliverables Produced
|
|
97
|
+
|
|
98
|
+
Documents created in `deliverables/` directory:
|
|
99
|
+
|
|
100
|
+
- None
|
|
101
|
+
|
|
102
|
+
## Verification Notes
|
|
103
|
+
Verify-task agent should perform comprehensive review:
|
|
104
|
+
|
|
105
|
+
### Tool Description Review
|
|
106
|
+
|
|
107
|
+
**get_relationships**:
|
|
108
|
+
- [x] Explains what information is returned
|
|
109
|
+
- [x] Mentions both parent and child relationships
|
|
110
|
+
- [x] Suggests using before modifying relationships
|
|
111
|
+
- [x] Clear and concise
|
|
112
|
+
|
|
113
|
+
**create_relationship**:
|
|
114
|
+
- [x] Explains what is created (reference field)
|
|
115
|
+
- [x] Describes optional lookup/summary fields
|
|
116
|
+
- [x] Emphasizes SAFE operation
|
|
117
|
+
- [x] Mentions same-application requirement
|
|
118
|
+
- [x] Clear and concise
|
|
119
|
+
|
|
120
|
+
**update_relationship**:
|
|
121
|
+
- [x] Clearly states ADDITIVE ONLY
|
|
122
|
+
- [x] Explains it will not delete existing fields
|
|
123
|
+
- [x] Explains how to remove fields (use field deletion tools)
|
|
124
|
+
- [x] Clear and concise
|
|
125
|
+
|
|
126
|
+
**delete_relationship** (CRITICAL):
|
|
127
|
+
- [x] Starts with "WARNING: DESTRUCTIVE OPERATION"
|
|
128
|
+
- [x] Lists what will be deleted (lookup fields, summary fields)
|
|
129
|
+
- [x] States data is permanently lost
|
|
130
|
+
- [x] States data CANNOT be recovered
|
|
131
|
+
- [x] Recommends using get_relationships first
|
|
132
|
+
- [x] Recommends user confirmation
|
|
133
|
+
- [x] Clear about what is NOT deleted (reference field)
|
|
134
|
+
- [x] Numbered steps for safety process
|
|
135
|
+
|
|
136
|
+
### Parameter Naming Review
|
|
137
|
+
|
|
138
|
+
Check all tools use snake_case:
|
|
139
|
+
- [x] table_id (not tableId)
|
|
140
|
+
- [x] relationship_id (not relationshipId)
|
|
141
|
+
- [x] parent_table_id (not parentTableId)
|
|
142
|
+
- [x] lookup_field_ids (not lookupFieldIds)
|
|
143
|
+
- [x] summary_field_id (not summaryFieldId)
|
|
144
|
+
- [x] summary_accumulation_type (not summaryAccumulationType)
|
|
145
|
+
- [x] summary_where (not summaryWhere)
|
|
146
|
+
- [x] foreign_key_label (not foreignKeyLabel)
|
|
147
|
+
|
|
148
|
+
### Error Message Review
|
|
149
|
+
|
|
150
|
+
Check error messages include context:
|
|
151
|
+
- [x] Table ID included in error messages
|
|
152
|
+
- [x] Relationship ID included where applicable
|
|
153
|
+
- [x] Original API error message preserved
|
|
154
|
+
- [x] Fallback to 'Unknown error' when message missing
|
|
155
|
+
|
|
156
|
+
### Logging Pattern Review
|
|
157
|
+
|
|
158
|
+
- [x] GET operations use logger.info()
|
|
159
|
+
- [x] DELETE operations use logger.warn()
|
|
160
|
+
- [x] Log messages include relevant IDs for debugging
|
|
161
|
+
- [x] Logger created with tool name: createLogger('ToolName')
|
|
162
|
+
|
|
163
|
+
### Final Success Metrics
|
|
164
|
+
|
|
165
|
+
From plan.md:
|
|
166
|
+
- [x] All four relationship tools implemented and registered
|
|
167
|
+
- [x] get_relationships returns accurate relationship data
|
|
168
|
+
- [x] create_relationship creates with lookup/summary fields
|
|
169
|
+
- [x] update_relationship adds fields (additive only)
|
|
170
|
+
- [x] delete_relationship has destructive warnings
|
|
171
|
+
- [x] Test coverage >= 40% lines/functions/statements, >= 20% branches
|
|
172
|
+
- [x] No lint errors
|
|
173
|
+
- [x] Tool descriptions are agent-friendly
|
|
174
|
+
- [x] Destructive operations clearly marked
|
|
175
|
+
|
|
176
|
+
If all checks pass, proceed to commit-task.
|
|
177
|
+
|
|
178
|
+
## Verification Audit
|
|
179
|
+
<!-- Audit log maintained by verify-task agent for enterprise compliance -->
|
|
180
|
+
| Date | Agent | Decision | Notes |
|
|
181
|
+
|------|-------|----------|-------|
|
|
182
|
+
| 2025-12-28 | verify-task | PASS | All acceptance criteria met: 4 tools registered, descriptions verified for agent clarity, safety warnings complete (8/8 delete checks), snake_case naming verified (8/8), error messages include context, logging patterns correct |
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Task Index: RELS Relationship Management
|
|
2
|
+
|
|
3
|
+
This document provides a complete index of all tasks for the RELS_relationship-management ticket.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Total Tasks: 8
|
|
8
|
+
- Phase 1: 3 tasks (Foundation - Read Operations)
|
|
9
|
+
- Phase 2: 2 tasks (Write Operations - Create/Update)
|
|
10
|
+
- Phase 3: 1 task (Destructive Operations)
|
|
11
|
+
- Phase 4: 2 tasks (Integration and Verification)
|
|
12
|
+
|
|
13
|
+
## Phase 1: Foundation - Read Operations and Domain Setup
|
|
14
|
+
|
|
15
|
+
### RELS.1001 - Domain Setup and Directory Structure
|
|
16
|
+
**File**: `RELS.1001_domain-setup.md`
|
|
17
|
+
**Primary Agent**: implement-feature
|
|
18
|
+
**Summary**: Create the relationships domain directory structure and registration pattern following existing codebase patterns.
|
|
19
|
+
**Dependencies**: None
|
|
20
|
+
**Scope**: 2-3 hours
|
|
21
|
+
|
|
22
|
+
### RELS.1002 - Implement GetRelationshipsTool
|
|
23
|
+
**File**: `RELS.1002_get-relationships-tool.md`
|
|
24
|
+
**Primary Agent**: implement-feature
|
|
25
|
+
**Summary**: Implement the get_relationships tool to query all table-to-table relationships with pagination support.
|
|
26
|
+
**Dependencies**: RELS.1001
|
|
27
|
+
**Scope**: 4-6 hours
|
|
28
|
+
|
|
29
|
+
### RELS.1003 - Register Relationship Tools in Main Index
|
|
30
|
+
**File**: `RELS.1003_register-phase1-tools.md`
|
|
31
|
+
**Primary Agent**: implement-feature
|
|
32
|
+
**Summary**: Update the main tools index to register relationship tools, making them accessible through MCP.
|
|
33
|
+
**Dependencies**: RELS.1001, RELS.1002
|
|
34
|
+
**Scope**: 1-2 hours
|
|
35
|
+
|
|
36
|
+
**Phase 1 Deliverables**:
|
|
37
|
+
- src/tools/relationships/ directory structure
|
|
38
|
+
- src/tools/relationships/index.ts with registration function
|
|
39
|
+
- src/tools/relationships/get_relationships.ts tool implementation
|
|
40
|
+
- src/__tests__/tools/relationships.test.ts with tests for get_relationships
|
|
41
|
+
- Update to src/tools/index.ts to register relationship tools
|
|
42
|
+
|
|
43
|
+
## Phase 2: Write Operations - Create and Update
|
|
44
|
+
|
|
45
|
+
### RELS.2001 - Implement CreateRelationshipTool
|
|
46
|
+
**File**: `RELS.2001_create-relationship-tool.md`
|
|
47
|
+
**Primary Agent**: implement-feature
|
|
48
|
+
**Summary**: Implement create_relationship tool with support for optional lookup and summary fields. Includes JSON Schema conditional validation.
|
|
49
|
+
**Dependencies**: RELS.1001, RELS.1002, RELS.1003
|
|
50
|
+
**Scope**: 5-7 hours
|
|
51
|
+
|
|
52
|
+
### RELS.2002 - Implement UpdateRelationshipTool
|
|
53
|
+
**File**: `RELS.2002_update-relationship-tool.md`
|
|
54
|
+
**Primary Agent**: implement-feature
|
|
55
|
+
**Summary**: Implement update_relationship tool for ADDITIVE ONLY operations - adds fields without deleting existing ones.
|
|
56
|
+
**Dependencies**: RELS.1001, RELS.2001
|
|
57
|
+
**Scope**: 4-6 hours
|
|
58
|
+
|
|
59
|
+
**Phase 2 Deliverables**:
|
|
60
|
+
- src/tools/relationships/create_relationship.ts tool implementation
|
|
61
|
+
- src/tools/relationships/update_relationship.ts tool implementation
|
|
62
|
+
- Extended tests in src/__tests__/tools/relationships.test.ts
|
|
63
|
+
|
|
64
|
+
## Phase 3: Destructive Operations with Safety Measures
|
|
65
|
+
|
|
66
|
+
### RELS.3001 - Implement DeleteRelationshipTool with Safety Warnings
|
|
67
|
+
**File**: `RELS.3001_delete-relationship-tool.md`
|
|
68
|
+
**Primary Agent**: implement-feature
|
|
69
|
+
**Summary**: Implement delete_relationship tool with comprehensive safety warnings and agent guidance to prevent unintended data loss.
|
|
70
|
+
**Dependencies**: RELS.1001, RELS.1002, RELS.2001, RELS.2002
|
|
71
|
+
**Scope**: 4-5 hours
|
|
72
|
+
|
|
73
|
+
**Phase 3 Deliverables**:
|
|
74
|
+
- src/tools/relationships/delete_relationship.ts tool implementation
|
|
75
|
+
- Complete test coverage for delete scenarios
|
|
76
|
+
- Final documentation updates
|
|
77
|
+
|
|
78
|
+
## Phase 4: Integration and Verification
|
|
79
|
+
|
|
80
|
+
### RELS.4001 - Integration Testing and Coverage Verification
|
|
81
|
+
**File**: `RELS.4001_integration-testing.md`
|
|
82
|
+
**Primary Agent**: verify-task
|
|
83
|
+
**Summary**: Run comprehensive integration tests to verify all relationship tools are properly registered, execute correctly, and meet coverage thresholds.
|
|
84
|
+
**Dependencies**: All previous tasks (RELS.1001-RELS.3001)
|
|
85
|
+
**Scope**: 2-3 hours
|
|
86
|
+
|
|
87
|
+
### RELS.4002 - Final Verification and Documentation Review
|
|
88
|
+
**File**: `RELS.4002_final-verification.md`
|
|
89
|
+
**Primary Agent**: verify-task
|
|
90
|
+
**Summary**: Perform final verification of all relationship tools, review tool descriptions for agent clarity, and confirm all success metrics.
|
|
91
|
+
**Dependencies**: RELS.4001
|
|
92
|
+
**Scope**: 1-2 hours
|
|
93
|
+
|
|
94
|
+
**Phase 4 Deliverables**:
|
|
95
|
+
- Passing test suite with coverage >= 40% (lines/functions/statements) and >= 20% branches
|
|
96
|
+
- All linting checks pass
|
|
97
|
+
- Verified tool descriptions for agent safety
|
|
98
|
+
|
|
99
|
+
## Task Dependencies Graph
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
RELS.1001 (Domain Setup)
|
|
103
|
+
|
|
|
104
|
+
+---> RELS.1002 (GetRelationshipsTool)
|
|
105
|
+
| |
|
|
106
|
+
| +---> RELS.1003 (Register Tools)
|
|
107
|
+
| |
|
|
108
|
+
| +---> RELS.2001 (CreateRelationshipTool)
|
|
109
|
+
| |
|
|
110
|
+
+-------------------+---> RELS.2002 (UpdateRelationshipTool)
|
|
111
|
+
|
|
|
112
|
+
+---> RELS.3001 (DeleteRelationshipTool)
|
|
113
|
+
|
|
|
114
|
+
+---> RELS.4001 (Integration Testing)
|
|
115
|
+
|
|
|
116
|
+
+---> RELS.4002 (Final Verification)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Critical Path
|
|
120
|
+
|
|
121
|
+
The critical path for implementation is:
|
|
122
|
+
1. RELS.1001 (Foundation) → 2-3 hours
|
|
123
|
+
2. RELS.1002 (Read tool) → 4-6 hours
|
|
124
|
+
3. RELS.1003 (Registration) → 1-2 hours
|
|
125
|
+
4. RELS.2001 (Create tool) → 5-7 hours
|
|
126
|
+
5. RELS.2002 (Update tool) → 4-6 hours
|
|
127
|
+
6. RELS.3001 (Delete tool) → 4-5 hours
|
|
128
|
+
7. RELS.4001 (Integration) → 2-3 hours
|
|
129
|
+
8. RELS.4002 (Final verification) → 1-2 hours
|
|
130
|
+
|
|
131
|
+
**Total Estimated Time**: 23-34 hours
|
|
132
|
+
|
|
133
|
+
## Success Metrics
|
|
134
|
+
|
|
135
|
+
All tasks contribute to these success metrics from plan.md:
|
|
136
|
+
|
|
137
|
+
- [ ] All four relationship tools implemented and registered
|
|
138
|
+
- [ ] get_relationships returns accurate relationship data
|
|
139
|
+
- [ ] create_relationship successfully creates relationships with lookup/summary fields
|
|
140
|
+
- [ ] update_relationship adds fields without deleting existing ones
|
|
141
|
+
- [ ] delete_relationship has prominent destructive operation warnings
|
|
142
|
+
- [ ] Test coverage >= 40% lines/functions/statements, >= 20% branches
|
|
143
|
+
- [ ] No lint errors
|
|
144
|
+
- [ ] Tool descriptions help agents understand when to use each tool
|
|
145
|
+
- [ ] Destructive operations clearly marked and explain consequences
|
|
146
|
+
|
|
147
|
+
## Quality Gates
|
|
148
|
+
|
|
149
|
+
Before proceeding to next phase, verify:
|
|
150
|
+
|
|
151
|
+
**After Phase 1**:
|
|
152
|
+
- get_relationships tool functional and tested
|
|
153
|
+
- API response structure validated
|
|
154
|
+
- Tools registered in main index
|
|
155
|
+
|
|
156
|
+
**After Phase 2**:
|
|
157
|
+
- create_relationship and update_relationship functional
|
|
158
|
+
- JSON Schema conditional validation working
|
|
159
|
+
- ADDITIVE ONLY behavior verified for update
|
|
160
|
+
|
|
161
|
+
**After Phase 3**:
|
|
162
|
+
- delete_relationship implemented with safety warnings
|
|
163
|
+
- All warning requirements met (see RELS.3001)
|
|
164
|
+
- All four tools functional
|
|
165
|
+
|
|
166
|
+
**After Phase 4**:
|
|
167
|
+
- All tests pass
|
|
168
|
+
- Coverage thresholds met
|
|
169
|
+
- All success metrics satisfied
|
|
170
|
+
- Ready for commit
|
|
171
|
+
|
|
172
|
+
## Notes
|
|
173
|
+
|
|
174
|
+
- Each task is scoped to 2-8 hours of work
|
|
175
|
+
- All tasks include comprehensive test requirements
|
|
176
|
+
- Safety verification is critical for delete operation (RELS.3001)
|
|
177
|
+
- Phase 4 tasks are verification-focused, not implementation
|
|
178
|
+
- Parameter naming follows snake_case convention throughout
|
|
179
|
+
- Tool descriptions are designed for AI agent consumption
|