sqlew 4.0.5 → 4.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.
- package/CHANGELOG.md +1805 -1782
- package/README.md +409 -468
- package/assets/claude-md-snippets/plan-mode-integration.md +17 -6
- package/assets/config.example.toml +282 -284
- package/assets/sample-agents/README.md +36 -40
- package/assets/sample-agents/sqlew-architect.md +321 -322
- package/assets/sample-agents/sqlew-researcher.md +292 -293
- package/assets/sample-agents/sqlew-scrum-master.md +286 -287
- package/assets/sample-commands/README.md +56 -57
- package/assets/sample-skills/sqlew-plan-guidance/SKILL.md +33 -26
- package/dist/cli/hooks/check-completion.d.ts +19 -0
- package/dist/cli/hooks/check-completion.d.ts.map +1 -0
- package/dist/cli/hooks/check-completion.js +104 -0
- package/dist/cli/hooks/check-completion.js.map +1 -0
- package/dist/cli/hooks/init-hooks.d.ts +35 -0
- package/dist/cli/hooks/init-hooks.d.ts.map +1 -0
- package/dist/cli/hooks/init-hooks.js +425 -0
- package/dist/cli/hooks/init-hooks.js.map +1 -0
- package/dist/cli/hooks/mark-done.d.ts +25 -0
- package/dist/cli/hooks/mark-done.d.ts.map +1 -0
- package/dist/cli/hooks/mark-done.js +128 -0
- package/dist/cli/hooks/mark-done.js.map +1 -0
- package/dist/cli/hooks/plan-id-utils.d.ts +83 -0
- package/dist/cli/hooks/plan-id-utils.d.ts.map +1 -0
- package/dist/cli/hooks/plan-id-utils.js +183 -0
- package/dist/cli/hooks/plan-id-utils.js.map +1 -0
- package/dist/cli/hooks/save.d.ts +23 -0
- package/dist/cli/hooks/save.d.ts.map +1 -0
- package/dist/cli/hooks/save.js +90 -0
- package/dist/cli/hooks/save.js.map +1 -0
- package/dist/cli/hooks/stdin-parser.d.ts +139 -0
- package/dist/cli/hooks/stdin-parser.d.ts.map +1 -0
- package/dist/cli/hooks/stdin-parser.js +127 -0
- package/dist/cli/hooks/stdin-parser.js.map +1 -0
- package/dist/cli/hooks/suggest.d.ts +19 -0
- package/dist/cli/hooks/suggest.d.ts.map +1 -0
- package/dist/cli/hooks/suggest.js +157 -0
- package/dist/cli/hooks/suggest.js.map +1 -0
- package/dist/cli/hooks/track-plan.d.ts +36 -0
- package/dist/cli/hooks/track-plan.d.ts.map +1 -0
- package/dist/cli/hooks/track-plan.js +152 -0
- package/dist/cli/hooks/track-plan.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -16
- package/dist/cli.js.map +1 -1
- package/dist/config/global-config.d.ts +187 -0
- package/dist/config/global-config.d.ts.map +1 -0
- package/dist/config/global-config.js +206 -0
- package/dist/config/global-config.js.map +1 -0
- package/dist/config/loader.d.ts +42 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +96 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -1
- package/dist/database/operations/queries.d.ts.map +1 -1
- package/dist/database/operations/queries.js +11 -2
- package/dist/database/operations/queries.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/init-agents.js +0 -1
- package/dist/init-agents.js.map +1 -1
- package/dist/init-skills.d.ts +4 -3
- package/dist/init-skills.d.ts.map +1 -1
- package/dist/init-skills.js +10 -3
- package/dist/init-skills.js.map +1 -1
- package/dist/server/setup.d.ts +8 -0
- package/dist/server/setup.d.ts.map +1 -1
- package/dist/server/setup.js +141 -21
- package/dist/server/setup.js.map +1 -1
- package/dist/sync-agents.d.ts.map +1 -1
- package/dist/sync-agents.js +48 -3
- package/dist/sync-agents.js.map +1 -1
- package/dist/sync-commands.d.ts.map +1 -1
- package/dist/sync-commands.js +43 -3
- package/dist/sync-commands.js.map +1 -1
- package/dist/tools/constraints/actions/get.d.ts.map +1 -1
- package/dist/tools/constraints/actions/get.js +5 -8
- package/dist/tools/constraints/actions/get.js.map +1 -1
- package/dist/tools/constraints/help/help.d.ts.map +1 -1
- package/dist/tools/constraints/help/help.js +1 -6
- package/dist/tools/constraints/help/help.js.map +1 -1
- package/dist/tools/context/actions/get.d.ts.map +1 -1
- package/dist/tools/context/actions/get.js.map +1 -1
- package/dist/tools/context/actions/search-layer.d.ts.map +1 -1
- package/dist/tools/context/actions/search-layer.js +5 -3
- package/dist/tools/context/actions/search-layer.js.map +1 -1
- package/dist/tools/context/actions/set-from-policy.d.ts +2 -1
- package/dist/tools/context/actions/set-from-policy.d.ts.map +1 -1
- package/dist/tools/context/actions/set-from-policy.js.map +1 -1
- package/dist/tools/context/help/help.d.ts.map +1 -1
- package/dist/tools/context/help/help.js +1 -7
- package/dist/tools/context/help/help.js.map +1 -1
- package/dist/tools/context/internal/queries.d.ts.map +1 -1
- package/dist/tools/context/internal/queries.js +5 -2
- package/dist/tools/context/internal/queries.js.map +1 -1
- package/dist/tools/context/types.d.ts +1 -1
- package/dist/tools/context/types.d.ts.map +1 -1
- package/dist/tools/files/actions/get.d.ts.map +1 -1
- package/dist/tools/files/actions/get.js +4 -6
- package/dist/tools/files/actions/get.js.map +1 -1
- package/dist/tools/files/help/help.d.ts.map +1 -1
- package/dist/tools/files/help/help.js +1 -6
- package/dist/tools/files/help/help.js.map +1 -1
- package/dist/tools/suggest/help/constraint-help.d.ts.map +1 -1
- package/dist/tools/suggest/help/constraint-help.js +0 -2
- package/dist/tools/suggest/help/constraint-help.js.map +1 -1
- package/dist/tools/suggest/internal/constraint-queries.d.ts.map +1 -1
- package/dist/tools/suggest/internal/constraint-queries.js +12 -5
- package/dist/tools/suggest/internal/constraint-queries.js.map +1 -1
- package/dist/tools/suggest/internal/queries.js +2 -2
- package/dist/tools/suggest/internal/queries.js.map +1 -1
- package/dist/tools/tasks/help/help.d.ts.map +1 -1
- package/dist/tools/tasks/help/help.js +0 -6
- package/dist/tools/tasks/help/help.js.map +1 -1
- package/dist/tools/tasks/help/use-case.d.ts.map +1 -1
- package/dist/tools/tasks/help/use-case.js +0 -1
- package/dist/tools/tasks/help/use-case.js.map +1 -1
- package/dist/tools/tasks/watcher/status.d.ts.map +1 -1
- package/dist/tools/tasks/watcher/status.js +5 -1
- package/dist/tools/tasks/watcher/status.js.map +1 -1
- package/dist/types/decision/params.d.ts +7 -6
- package/dist/types/decision/params.d.ts.map +1 -1
- package/dist/types/decision/templates.d.ts +3 -2
- package/dist/types/decision/templates.d.ts.map +1 -1
- package/dist/types/view-entities.d.ts +2 -1
- package/dist/types/view-entities.d.ts.map +1 -1
- package/dist/types.d.ts +19 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/enum-converter.d.ts +72 -0
- package/dist/utils/enum-converter.d.ts.map +1 -0
- package/dist/utils/enum-converter.js +76 -0
- package/dist/utils/enum-converter.js.map +1 -0
- package/dist/utils/hook-queue.d.ts +81 -0
- package/dist/utils/hook-queue.d.ts.map +1 -0
- package/dist/utils/hook-queue.js +156 -0
- package/dist/utils/hook-queue.js.map +1 -0
- package/dist/utils/project-root.d.ts +9 -2
- package/dist/utils/project-root.d.ts.map +1 -1
- package/dist/utils/project-root.js +16 -2
- package/dist/utils/project-root.js.map +1 -1
- package/dist/utils/tag-parser.d.ts.map +1 -1
- package/dist/utils/tag-parser.js +6 -0
- package/dist/utils/tag-parser.js.map +1 -1
- package/dist/utils/validators.d.ts +1 -1
- package/dist/utils/validators.d.ts.map +1 -1
- package/dist/utils/validators.js +1 -1
- package/dist/utils/validators.js.map +1 -1
- package/dist/utils/vcs-adapter.d.ts +44 -0
- package/dist/utils/vcs-adapter.d.ts.map +1 -1
- package/dist/utils/vcs-adapter.js +88 -0
- package/dist/utils/vcs-adapter.js.map +1 -1
- package/dist/utils/view-queries.d.ts.map +1 -1
- package/dist/utils/view-queries.js +9 -19
- package/dist/utils/view-queries.js.map +1 -1
- package/dist/watcher/base-watcher.d.ts +69 -0
- package/dist/watcher/base-watcher.d.ts.map +1 -0
- package/dist/watcher/base-watcher.js +130 -0
- package/dist/watcher/base-watcher.js.map +1 -0
- package/dist/watcher/index.d.ts +3 -0
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js +2 -0
- package/dist/watcher/index.js.map +1 -1
- package/dist/watcher/queue-watcher.d.ts +64 -0
- package/dist/watcher/queue-watcher.d.ts.map +1 -0
- package/dist/watcher/queue-watcher.js +187 -0
- package/dist/watcher/queue-watcher.js.map +1 -0
- package/docs/ADR_CONCEPTS.md +140 -0
- package/docs/CONFIGURATION.md +922 -925
- package/docs/CROSS_DATABASE.md +153 -0
- package/docs/DATABASE_AUTH.md +70 -356
- package/docs/HOOKS_GUIDE.md +159 -0
- package/docs/SLASH_COMMANDS.md +329 -337
- package/docs/TASK_SYSTEM_DEPRECATED.md +88 -0
- package/docs/changelogs/CHANGELOG_ARCHIVE_v3.4_and_older.md +293 -296
- package/docs/cli/DATA_EXPORT_IMPORT.md +699 -700
- package/docs/cli/README.md +276 -277
- package/package.json +123 -124
- package/docs/ACCEPTANCE_CRITERIA.md +0 -625
- package/docs/AI_AGENT_GUIDE.md +0 -299
- package/docs/ARCHITECTURE.md +0 -167
- package/docs/AUTO_FILE_TRACKING.md +0 -841
- package/docs/BATCH_VALIDATION.md +0 -617
- package/docs/BEST_PRACTICES.md +0 -168
- package/docs/CONSTRAINT_INTELLIGENCE.md +0 -339
- package/docs/DECISION_CONTEXT.md +0 -697
- package/docs/DECISION_INTELLIGENCE.md +0 -605
- package/docs/GIT_AWARE_AUTO_COMPLETE.md +0 -646
- package/docs/MIGRATION_GUIDE_V3.9.0.md +0 -371
- package/docs/SHARED_CONCEPTS.md +0 -225
- package/docs/SPECIALIZED_AGENTS.md +0 -126
- package/docs/TASK_ACTIONS.md +0 -1177
- package/docs/TASK_OVERVIEW.md +0 -452
- package/docs/TASK_PRUNING.md +0 -594
- package/docs/TOOL_REFERENCE.md +0 -1077
- package/docs/TOOL_SELECTION.md +0 -83
- package/docs/WORKFLOWS.md +0 -941
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
# Migration Guide: v3.9.0
|
|
2
|
-
|
|
3
|
-
**Release Date:** 2025-11-14
|
|
4
|
-
**Status:** Production Ready
|
|
5
|
-
**Compatibility:** Fully backward compatible with v3.8.x
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
v3.9.0 introduces the **Decision Intelligence System** with the new `suggest` tool, along with critical bug fixes for cross-database compatibility and improved test organization.
|
|
12
|
-
|
|
13
|
-
### Quick Summary
|
|
14
|
-
|
|
15
|
-
**✅ No Breaking Changes**
|
|
16
|
-
**✅ Automatic Migration**
|
|
17
|
-
**✅ Zero Downtime**
|
|
18
|
-
**🆕 New suggest Tool**
|
|
19
|
-
**🐛 PostgreSQL/MySQL Fixes**
|
|
20
|
-
**🧪 Better Test Organization**
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## What's New
|
|
25
|
-
|
|
26
|
-
### 1. Decision Intelligence System (suggest Tool)
|
|
27
|
-
|
|
28
|
-
**Purpose:** Intelligent decision discovery, duplicate prevention, and consistency maintenance.
|
|
29
|
-
|
|
30
|
-
**New Actions:**
|
|
31
|
-
```typescript
|
|
32
|
-
// Find decisions by key pattern
|
|
33
|
-
suggest({ action: "by_key", key: "api/*/latency", limit: 5, min_score: 30 })
|
|
34
|
-
|
|
35
|
-
// Find decisions by tag similarity
|
|
36
|
-
suggest({ action: "by_tags", tags: ["performance", "api"], limit: 5 })
|
|
37
|
-
|
|
38
|
-
// Combined search (key + tags + layer)
|
|
39
|
-
suggest({ action: "by_context", key: "api/*", tags: ["performance"], layer: "infrastructure" })
|
|
40
|
-
|
|
41
|
-
// Check for duplicates before creation
|
|
42
|
-
suggest({ action: "check_duplicate", key: "api/users/get/latency", tags: ["api", "performance"] })
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Auto-Trigger Integration:**
|
|
46
|
-
When policies have `suggest_similar=1`, suggestions are automatically triggered and returned in `decision.set` response:
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
const result = await decision({
|
|
50
|
-
action: "set",
|
|
51
|
-
key: "security/cve/2024-001",
|
|
52
|
-
value: "critical",
|
|
53
|
-
tags: ["security", "vulnerability"]
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// Response includes auto-triggered suggestions
|
|
57
|
-
{
|
|
58
|
-
success: true,
|
|
59
|
-
key: "security/cve/2024-001",
|
|
60
|
-
version: "1.0.0",
|
|
61
|
-
suggestions: {
|
|
62
|
-
triggered_by: "security-policy",
|
|
63
|
-
reason: "Policy has suggest_similar enabled",
|
|
64
|
-
suggestions: [
|
|
65
|
-
{
|
|
66
|
-
key: "security/cve/2023-999",
|
|
67
|
-
similarity_score: 85,
|
|
68
|
-
tags: ["security", "vulnerability"],
|
|
69
|
-
layer: "cross-cutting"
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
**Use Cases:**
|
|
77
|
-
- Prevent duplicate decisions
|
|
78
|
-
- Find related decisions for consistency
|
|
79
|
-
- Discover decisions by pattern (e.g., all API latency metrics)
|
|
80
|
-
- Maintain architectural consistency across layers
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
## Migration Steps
|
|
85
|
-
|
|
86
|
-
### Step 1: Backup Your Database
|
|
87
|
-
|
|
88
|
-
**IMPORTANT:** Always backup before upgrading.
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
# Backup SQLite database
|
|
92
|
-
cp .sqlew/sqlew.db .sqlew/sqlew.db.backup-$(date +%Y%m%d)
|
|
93
|
-
|
|
94
|
-
# Backup PostgreSQL (if using)
|
|
95
|
-
pg_dump -h localhost -U sqlew_user sqlew_db > backup-$(date +%Y%m%d).sql
|
|
96
|
-
|
|
97
|
-
# Backup MySQL (if using)
|
|
98
|
-
mysqldump -h localhost -u sqlew_user -p sqlew_db > backup-$(date +%Y%m%d).sql
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Step 2: Update sqlew
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
# Update via npm
|
|
105
|
-
npm update sqlew
|
|
106
|
-
|
|
107
|
-
# Or reinstall specific version
|
|
108
|
-
npm install sqlew@3.9.0
|
|
109
|
-
|
|
110
|
-
# Or use npx (recommended)
|
|
111
|
-
# Update .mcp.json:
|
|
112
|
-
{
|
|
113
|
-
"mcpServers": {
|
|
114
|
-
"sqlew": {
|
|
115
|
-
"command": "npx",
|
|
116
|
-
"args": ["sqlew@3.9.0"]
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Step 3: Restart Claude Code
|
|
123
|
-
|
|
124
|
-
The server will automatically run migrations on startup.
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
# Restart Claude Code or MCP inspector
|
|
128
|
-
# Migrations run automatically
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Step 4: Verify Migration
|
|
132
|
-
|
|
133
|
-
Check migration status:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
# Inspect database
|
|
137
|
-
sqlite3 .sqlew/sqlew.db "SELECT * FROM knex_migrations ORDER BY id DESC LIMIT 5;"
|
|
138
|
-
|
|
139
|
-
# Expected latest migrations:
|
|
140
|
-
# - 20251114000000_fix_v_tagged_decisions_numeric_support
|
|
141
|
-
# - 20251112000002_fix_task_pruned_files_schema_v3_9_0
|
|
142
|
-
# - 20251112000001_fix_task_file_links_schema_v3_9_0
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Step 5: Test suggest Tool
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# Test suggest tool
|
|
149
|
-
npx @modelcontextprotocol/inspector npx sqlew
|
|
150
|
-
|
|
151
|
-
# In inspector:
|
|
152
|
-
suggest({ action: "help" })
|
|
153
|
-
suggest({ action: "by_key", key: "*" })
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Bug Fixes Included
|
|
159
|
-
|
|
160
|
-
### 1. PostgreSQL CAST Type Mismatch (Critical)
|
|
161
|
-
|
|
162
|
-
**Issue:** PostgreSQL rejected `COALESCE(TEXT, NUMERIC)` in `v_tagged_decisions` view.
|
|
163
|
-
|
|
164
|
-
**Fixed:**
|
|
165
|
-
- Migration adds database-specific CAST syntax
|
|
166
|
-
- SQL dump export converts views correctly
|
|
167
|
-
- All 20 cross-database tests passing
|
|
168
|
-
|
|
169
|
-
**Impact:** If you use PostgreSQL or export to PostgreSQL, this fixes import errors.
|
|
170
|
-
|
|
171
|
-
### 2. FK Constraint Cleanup Order
|
|
172
|
-
|
|
173
|
-
**Issue:** E2E tests failed with FK constraint violations during cleanup.
|
|
174
|
-
|
|
175
|
-
**Fixed:**
|
|
176
|
-
- Reordered cleanup to delete child records first
|
|
177
|
-
- All 3 e2e workflow tests passing
|
|
178
|
-
|
|
179
|
-
**Impact:** Better test reliability, no functional changes for users.
|
|
180
|
-
|
|
181
|
-
### 3. Task File Links Schema
|
|
182
|
-
|
|
183
|
-
**Issue:** UNIQUE constraint incorrectly configured on `t_task_file_links`.
|
|
184
|
-
|
|
185
|
-
**Fixed:**
|
|
186
|
-
- Migration `20251112000001_fix_task_file_links_schema_v3_9_0.ts`
|
|
187
|
-
- Idempotent with existence checks
|
|
188
|
-
|
|
189
|
-
**Impact:** Better data integrity for task file tracking.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Test Organization Changes
|
|
194
|
-
|
|
195
|
-
### Docker Test Separation
|
|
196
|
-
|
|
197
|
-
**Old Structure:**
|
|
198
|
-
```
|
|
199
|
-
src/tests/database/
|
|
200
|
-
├── sql-dump/
|
|
201
|
-
│ ├── cross-database.test.ts # Required Docker
|
|
202
|
-
│ └── ...
|
|
203
|
-
└── migrations/
|
|
204
|
-
└── schema-migration.test.ts # Required Docker
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
**New Structure:**
|
|
208
|
-
```
|
|
209
|
-
src/tests/
|
|
210
|
-
├── docker/ # NEW - Docker-dependent tests
|
|
211
|
-
│ ├── cross-database.test.ts
|
|
212
|
-
│ ├── schema-migration.test.ts
|
|
213
|
-
│ └── ... (7 tests total)
|
|
214
|
-
└── database/ # Unit tests only (no Docker)
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
**Commands:**
|
|
218
|
-
```bash
|
|
219
|
-
# Unit tests only (no Docker needed)
|
|
220
|
-
npm test # 481/481 tests, 0 failures
|
|
221
|
-
|
|
222
|
-
# Docker tests (requires containers)
|
|
223
|
-
npm run test:docker # 7 test suites
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
**Impact:** Faster CI, clearer test failures, no Docker dependency for `npm test`.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Git Hook Enhancement
|
|
231
|
-
|
|
232
|
-
### Pre-Commit Migration Check
|
|
233
|
-
|
|
234
|
-
**Old Behavior:** Prevented editing any committed migration files.
|
|
235
|
-
|
|
236
|
-
**New Behavior:** Prevents editing **PUSHED** migration files only.
|
|
237
|
-
|
|
238
|
-
**Benefits:**
|
|
239
|
-
- ✅ Edit locally committed migrations (not yet pushed)
|
|
240
|
-
- ✅ Prevents editing pushed migrations (already deployed)
|
|
241
|
-
- ✅ Auto-detects remote branch (origin/main, origin/master, origin/dev)
|
|
242
|
-
- ✅ Graceful fallback for local-only repos
|
|
243
|
-
|
|
244
|
-
**Example:**
|
|
245
|
-
```bash
|
|
246
|
-
# ✅ ALLOWED - Edit local migration (not pushed)
|
|
247
|
-
git commit -m "Fix migration before push"
|
|
248
|
-
|
|
249
|
-
# ❌ BLOCKED - Edit pushed migration
|
|
250
|
-
# Error: PUSHED migration file was edited: src/config/knex/enhancements/20251114000000_fix_v_tagged_decisions_numeric_support.ts
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
## Rollback Procedure
|
|
256
|
-
|
|
257
|
-
If you encounter issues:
|
|
258
|
-
|
|
259
|
-
### Option 1: Restore Database Backup
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
# SQLite
|
|
263
|
-
cp .sqlew/sqlew.db.backup-YYYYMMDD .sqlew/sqlew.db
|
|
264
|
-
|
|
265
|
-
# PostgreSQL
|
|
266
|
-
psql -h localhost -U sqlew_user sqlew_db < backup-YYYYMMDD.sql
|
|
267
|
-
|
|
268
|
-
# MySQL
|
|
269
|
-
mysql -h localhost -u sqlew_user -p sqlew_db < backup-YYYYMMDD.sql
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### Option 2: Downgrade to v3.8.1
|
|
273
|
-
|
|
274
|
-
```bash
|
|
275
|
-
# Restore backup first (see above)
|
|
276
|
-
|
|
277
|
-
# Then downgrade
|
|
278
|
-
npm install sqlew@3.8.1
|
|
279
|
-
|
|
280
|
-
# Or update .mcp.json
|
|
281
|
-
{
|
|
282
|
-
"mcpServers": {
|
|
283
|
-
"sqlew": {
|
|
284
|
-
"command": "npx",
|
|
285
|
-
"args": ["sqlew@3.8.1"]
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
## Known Issues
|
|
294
|
-
|
|
295
|
-
**None reported as of v3.9.0 release.**
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
## FAQ
|
|
300
|
-
|
|
301
|
-
### Q: Do I need to update my code?
|
|
302
|
-
|
|
303
|
-
**A:** No. v3.9.0 is fully backward compatible. The `suggest` tool is optional.
|
|
304
|
-
|
|
305
|
-
### Q: Will my existing decisions/tasks work?
|
|
306
|
-
|
|
307
|
-
**A:** Yes. All existing data is preserved and migrations are automatic.
|
|
308
|
-
|
|
309
|
-
### Q: How do I use the suggest tool?
|
|
310
|
-
|
|
311
|
-
**A:** Use `suggest({ action: "help" })` for documentation. See examples above.
|
|
312
|
-
|
|
313
|
-
### Q: Do I need Docker for testing?
|
|
314
|
-
|
|
315
|
-
**A:** No. `npm test` runs 481 unit tests without Docker. Docker tests are optional: `npm run test:docker`.
|
|
316
|
-
|
|
317
|
-
### Q: Can I edit migrations locally?
|
|
318
|
-
|
|
319
|
-
**A:** Yes, if not pushed yet. The pre-commit hook now allows editing local migrations.
|
|
320
|
-
|
|
321
|
-
### Q: What if migration fails?
|
|
322
|
-
|
|
323
|
-
**A:** Restore backup (see Rollback Procedure above) and report issue on GitHub.
|
|
324
|
-
|
|
325
|
-
---
|
|
326
|
-
|
|
327
|
-
## Performance Notes
|
|
328
|
-
|
|
329
|
-
### Code Reduction
|
|
330
|
-
|
|
331
|
-
- **Deleted:** `src/utils/sql-dump.ts` (-1,799 lines)
|
|
332
|
-
- **Added:** Suggest tool system (+765 lines)
|
|
333
|
-
- **Net:** -239 lines (1.1% code reduction)
|
|
334
|
-
|
|
335
|
-
### Test Coverage
|
|
336
|
-
|
|
337
|
-
- **Unit Tests:** 481 tests, 64.85% coverage
|
|
338
|
-
- **E2E Tests:** 3 workflows, 100% passing
|
|
339
|
-
- **Cross-DB Tests:** 20 tests, 100% passing (MySQL, MariaDB, PostgreSQL)
|
|
340
|
-
|
|
341
|
-
---
|
|
342
|
-
|
|
343
|
-
## Support
|
|
344
|
-
|
|
345
|
-
**Issues:** https://github.com/anthropics/sqlew/issues
|
|
346
|
-
**Documentation:** See CHANGELOG.md, CLAUDE.md, and docs/
|
|
347
|
-
**Migration Assistance:** Open GitHub issue with error logs
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## Verification Checklist
|
|
352
|
-
|
|
353
|
-
After migration, verify:
|
|
354
|
-
|
|
355
|
-
- [ ] Server starts without errors
|
|
356
|
-
- [ ] Existing decisions/tasks queryable
|
|
357
|
-
- [ ] suggest tool available: `suggest({ action: "help" })`
|
|
358
|
-
- [ ] Unit tests pass: `npm test` (if running locally)
|
|
359
|
-
- [ ] Database migrations applied: Check `knex_migrations` table
|
|
360
|
-
- [ ] No error logs in `.sqlew/logs/` (if logging enabled)
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
## Next Steps
|
|
365
|
-
|
|
366
|
-
1. **Explore suggest tool** - Try pattern searches and duplicate detection
|
|
367
|
-
2. **Enable auto-trigger** - Add `suggest_similar=1` to policies
|
|
368
|
-
3. **Update documentation** - Document decisions using suggest tool
|
|
369
|
-
4. **Run Docker tests** - Verify cross-database compatibility (optional)
|
|
370
|
-
|
|
371
|
-
**Welcome to v3.9.0! 🎉**
|
package/docs/SHARED_CONCEPTS.md
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
# Shared Concepts Reference
|
|
2
|
-
|
|
3
|
-
> **Single Source of Truth** - Common concepts used across all MCP-SQLEW documentation.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
- [Architecture Layers](#architecture-layers)
|
|
7
|
-
- [Enum Values Reference](#enum-values-reference)
|
|
8
|
-
- [Atomic Mode](#atomic-mode)
|
|
9
|
-
- [Action Parameter](#action-parameter)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Architecture Layers
|
|
14
|
-
|
|
15
|
-
9-layer architecture for organizing decisions, constraints, file changes, and tasks:
|
|
16
|
-
|
|
17
|
-
### FILE_REQUIRED Layers (6)
|
|
18
|
-
|
|
19
|
-
#### 1. **presentation** - User Interface
|
|
20
|
-
UI components, API endpoints, CLI handlers, forms, response formatting
|
|
21
|
-
|
|
22
|
-
**Examples**: React components, REST controllers, web forms
|
|
23
|
-
|
|
24
|
-
#### 2. **business** - Business Logic
|
|
25
|
-
Core application logic, business rules, domain operations
|
|
26
|
-
|
|
27
|
-
**Examples**: Service classes, domain models, workflows, validation rules
|
|
28
|
-
|
|
29
|
-
#### 3. **data** - Data Access
|
|
30
|
-
Data persistence and retrieval
|
|
31
|
-
|
|
32
|
-
**Examples**: Database schemas, repositories, ORMs, queries
|
|
33
|
-
|
|
34
|
-
#### 4. **infrastructure** - Infrastructure
|
|
35
|
-
Technical capabilities and external services
|
|
36
|
-
|
|
37
|
-
**Examples**: Auth, logging, message queues, caching, email/SMS services
|
|
38
|
-
|
|
39
|
-
#### 5. **cross-cutting** - Cross-Cutting Concerns
|
|
40
|
-
Aspects spanning multiple layers
|
|
41
|
-
|
|
42
|
-
**Examples**: Error handling, security, performance, i18n, configuration
|
|
43
|
-
|
|
44
|
-
#### 6. **documentation** - Documentation & Knowledge
|
|
45
|
-
Project documentation, guides, API docs, code comments, design rationales
|
|
46
|
-
|
|
47
|
-
**Examples**: README files, API documentation, architecture guides, inline comments
|
|
48
|
-
|
|
49
|
-
### FILE_OPTIONAL Layers (3)
|
|
50
|
-
|
|
51
|
-
#### 7. **planning** - Planning & Requirements
|
|
52
|
-
Project planning, roadmap decisions, requirements gathering, estimation
|
|
53
|
-
|
|
54
|
-
**Examples**: Roadmap items, feature specifications, sprint planning, estimation notes
|
|
55
|
-
|
|
56
|
-
#### 8. **coordination** - Team Coordination
|
|
57
|
-
Team communication, progress tracking, meeting notes, status updates
|
|
58
|
-
|
|
59
|
-
**Examples**: Meeting notes, status updates, progress reports, team announcements
|
|
60
|
-
|
|
61
|
-
#### 9. **review** - Review & Quality Assurance
|
|
62
|
-
Code reviews, testing decisions, quality metrics, approval workflows
|
|
63
|
-
|
|
64
|
-
**Examples**: Review comments, testing strategies, quality gates, approval notes
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Enum Values Reference
|
|
69
|
-
|
|
70
|
-
### layer (Architecture Layers)
|
|
71
|
-
```typescript
|
|
72
|
-
type Layer =
|
|
73
|
-
| "presentation" // UI, API endpoints, user interaction
|
|
74
|
-
| "business" // Core logic, domain models, workflows
|
|
75
|
-
| "data" // Database, repositories, persistence
|
|
76
|
-
| "infrastructure" // Auth, logging, external services
|
|
77
|
-
| "cross-cutting" // Security, error handling, i18n
|
|
78
|
-
| "documentation" // Project docs, guides, comments
|
|
79
|
-
| "planning" // Planning, roadmap, requirements (file-optional)
|
|
80
|
-
| "coordination" // Team communication, status updates (file-optional)
|
|
81
|
-
| "review" // Code reviews, QA, approval (file-optional)
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### status (Decision/Entity Status)
|
|
85
|
-
```typescript
|
|
86
|
-
type Status =
|
|
87
|
-
| "active" // Currently in use and valid (default)
|
|
88
|
-
| "deprecated" // Outdated but not removed, scheduled for removal
|
|
89
|
-
| "draft" // Proposed but not yet approved/implemented
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### msg_type (Message Type)
|
|
93
|
-
```typescript
|
|
94
|
-
type MessageType =
|
|
95
|
-
| "decision" // Decision announcement or update
|
|
96
|
-
| "warning" // Alert or cautionary message
|
|
97
|
-
| "request" // Request for action or input
|
|
98
|
-
| "info" // Informational message
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### priority (Priority Level)
|
|
102
|
-
```typescript
|
|
103
|
-
type Priority =
|
|
104
|
-
| "low" // Can be addressed later
|
|
105
|
-
| "medium" // Normal priority (default)
|
|
106
|
-
| "high" // Should be addressed soon
|
|
107
|
-
| "critical" // Requires immediate attention
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### change_type (File Change Type)
|
|
111
|
-
```typescript
|
|
112
|
-
type ChangeType =
|
|
113
|
-
| "created" // New file added
|
|
114
|
-
| "modified" // Existing file changed
|
|
115
|
-
| "deleted" // File removed
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### category (Constraint Categories)
|
|
119
|
-
```typescript
|
|
120
|
-
type ConstraintCategory =
|
|
121
|
-
| "performance" // Performance requirements and limits
|
|
122
|
-
| "architecture" // Architectural rules and patterns
|
|
123
|
-
| "security" // Security policies and restrictions
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### task_status (Kanban Task Status)
|
|
127
|
-
```typescript
|
|
128
|
-
type TaskStatus =
|
|
129
|
-
| "todo" // Not started, ready to begin
|
|
130
|
-
| "in_progress" // Currently being worked on
|
|
131
|
-
| "waiting_review" // Completed, awaiting review/approval
|
|
132
|
-
| "blocked" // Cannot proceed due to blocker
|
|
133
|
-
| "done" // Completed and approved
|
|
134
|
-
| "archived" // Archived for historical reference
|
|
135
|
-
| "rejected" // Rejected/cancelled (v4.1.0)
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**Valid Transitions** (v4.1.0 - relaxed rules):
|
|
139
|
-
|
|
140
|
-
| Status Type | Statuses | Can Transition To |
|
|
141
|
-
|-------------|----------|-------------------|
|
|
142
|
-
| **Non-terminal** | todo, in_progress, waiting_review, blocked, done | Any status (including terminal) |
|
|
143
|
-
| **Terminal** | archived, rejected | None (final states) |
|
|
144
|
-
|
|
145
|
-
- Non-terminal statuses can freely move to any other status
|
|
146
|
-
- Terminal statuses (`archived`, `rejected`) cannot transition
|
|
147
|
-
- `rejected` requires optional `rejection_reason` parameter
|
|
148
|
-
|
|
149
|
-
**Auto-Stale Detection & Auto-Archive**:
|
|
150
|
-
- `in_progress` >2 hours → auto-move to `waiting_review`
|
|
151
|
-
- `waiting_review` >24 hours → auto-move to `todo`
|
|
152
|
-
- `done` >48 hours → auto-move to `archived` (weekend-aware)
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Atomic Mode
|
|
157
|
-
|
|
158
|
-
Determines batch operation failure handling:
|
|
159
|
-
|
|
160
|
-
**`atomic: true`** (All-or-Nothing) - Default
|
|
161
|
-
- ALL succeed or ALL fail
|
|
162
|
-
- Database transaction with rollback
|
|
163
|
-
- Guaranteed consistency
|
|
164
|
-
|
|
165
|
-
**`atomic: false`** (Best-Effort)
|
|
166
|
-
- Independent operations
|
|
167
|
-
- Partial success possible
|
|
168
|
-
- Failed items reported
|
|
169
|
-
|
|
170
|
-
### When to Use
|
|
171
|
-
|
|
172
|
-
**Use `atomic: true`** for:
|
|
173
|
-
- Critical data consistency (financial, multi-step workflows)
|
|
174
|
-
- All-or-nothing validation
|
|
175
|
-
|
|
176
|
-
**Use `atomic: false`** for:
|
|
177
|
-
- Bulk imports with expected failures
|
|
178
|
-
- AI agent best-effort updates
|
|
179
|
-
- Performance-critical operations
|
|
180
|
-
|
|
181
|
-
### Supported Tools
|
|
182
|
-
- `decision`: `set_batch`
|
|
183
|
-
- `file`: `record_batch`
|
|
184
|
-
- `task`: `create_batch`
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Action Parameter
|
|
189
|
-
|
|
190
|
-
**`action` parameter is REQUIRED in all tool calls**
|
|
191
|
-
|
|
192
|
-
### Why Required?
|
|
193
|
-
- Token efficiency: 96% reduction (20 tools → 7 tools)
|
|
194
|
-
- Logical grouping of related operations
|
|
195
|
-
- On-demand help via `action: "help"`
|
|
196
|
-
|
|
197
|
-
### Common Error
|
|
198
|
-
```json
|
|
199
|
-
❌ ERROR: "Unknown action: undefined"
|
|
200
|
-
|
|
201
|
-
// Fix: Always include action
|
|
202
|
-
✅ { "action": "get", "key": "auth_method" }
|
|
203
|
-
❌ { "key": "auth_method" }
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Available Actions
|
|
207
|
-
|
|
208
|
-
- **decision**: set, get, list, search_tags, search_layer, versions, set_batch, help
|
|
209
|
-
- **file**: record, get, check_lock, record_batch, help
|
|
210
|
-
- **constraint**: add, get, deactivate, help
|
|
211
|
-
- **stats**: layer_summary, db_stats, clear, help
|
|
212
|
-
- **config**: get, update, help
|
|
213
|
-
- **task**: create, update, get, list, move, link, archive, create_batch, help
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## Database Enum Mappings
|
|
218
|
-
|
|
219
|
-
Enum values stored as integers (MCP tools auto-convert - use strings in calls):
|
|
220
|
-
|
|
221
|
-
- **status**: 1=active, 2=deprecated, 3=draft
|
|
222
|
-
- **msg_type**: 1=decision, 2=warning, 3=request, 4=info
|
|
223
|
-
- **priority**: 1=low, 2=medium, 3=high, 4=critical
|
|
224
|
-
- **change_type**: 1=created, 2=modified, 3=deleted
|
|
225
|
-
- **task_status**: 1=todo, 2=in_progress, 3=waiting_review, 4=blocked, 5=done, 6=archived, 7=rejected
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
# Specialized Agents (Deprecated)
|
|
2
|
-
|
|
3
|
-
**Status**: Deprecated as of v4.1.0 - Replaced by unified `/sqlew` command
|
|
4
|
-
|
|
5
|
-
This document is kept for reference. For current usage, see [SLASH_COMMANDS.md](SLASH_COMMANDS.md).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Migration to /sqlew Command
|
|
10
|
-
|
|
11
|
-
As of v4.1.0, the custom agent system has been superseded by the unified `/sqlew` command with automatic intent detection.
|
|
12
|
-
|
|
13
|
-
### Old Approach (v4.0 and earlier)
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# Custom agents
|
|
17
|
-
@sqlew-scrum-master "Create sprint plan"
|
|
18
|
-
@sqlew-researcher "Find auth decisions"
|
|
19
|
-
@sqlew-architect "Document OAuth2 decision"
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### New Approach (v4.1.0+)
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Unified command with intent detection
|
|
26
|
-
/sqlew plan sprint implementation
|
|
27
|
-
/sqlew search for auth decisions
|
|
28
|
-
/sqlew record OAuth2 decision for authentication
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Historical Agent System
|
|
34
|
-
|
|
35
|
-
For reference, the v4.0.0 system included:
|
|
36
|
-
|
|
37
|
-
| Agent | Role | Purpose |
|
|
38
|
-
|-------|------|---------|
|
|
39
|
-
| **Scrum Master** | Task coordination, sprint planning | Multi-agent task coordination |
|
|
40
|
-
| **Researcher** | Query history, analyze patterns | Decision and constraint queries |
|
|
41
|
-
| **Architect** | Document decisions, enforce constraints | Architectural decision documentation |
|
|
42
|
-
|
|
43
|
-
### Why the Change?
|
|
44
|
-
|
|
45
|
-
1. **Unified Interface**: Single `/sqlew` command instead of remembering three agent names
|
|
46
|
-
2. **Automatic Intent Detection**: Command analyzes input and selects appropriate MCP tool
|
|
47
|
-
3. **Natural Language**: No need to know about "agents" - just describe what you want
|
|
48
|
-
4. **Better Discoverability**: One command in autocomplete instead of three agent references
|
|
49
|
-
5. **Token Efficiency**: Reduced context overhead from agent system
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Current Architecture (v4.1.0+)
|
|
54
|
-
|
|
55
|
-
The `/sqlew` command provides all the functionality of the previous agent system:
|
|
56
|
-
|
|
57
|
-
- **Intent Analysis** (replaces agent role selection)
|
|
58
|
-
- **MCP Tool Invocation** (replaces direct agent calls)
|
|
59
|
-
- **Automatic Routing** (replaces manual agent selection)
|
|
60
|
-
|
|
61
|
-
See [SLASH_COMMANDS.md](SLASH_COMMANDS.md) for current usage patterns.
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Configuration (Legacy - Not Used in v4.1.0+)
|
|
66
|
-
|
|
67
|
-
The following configuration was used in v4.0 and is no longer applicable:
|
|
68
|
-
|
|
69
|
-
```toml
|
|
70
|
-
# DEPRECATED - v4.0.0 and earlier
|
|
71
|
-
[agents]
|
|
72
|
-
scrum_master = true
|
|
73
|
-
researcher = true
|
|
74
|
-
architect = true
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
All agent functionality is now handled by the `/sqlew` command with no additional configuration needed.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Related Documentation
|
|
82
|
-
|
|
83
|
-
- [SLASH_COMMANDS.md](SLASH_COMMANDS.md) - Current `/sqlew` command documentation
|
|
84
|
-
- [TOOL_REFERENCE.md](TOOL_REFERENCE.md) - MCP tools (underlying infrastructure)
|
|
85
|
-
- [AI_AGENT_GUIDE.md](AI_AGENT_GUIDE.md) - Guidelines for AI agents using sqlew
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Legacy Reference
|
|
90
|
-
|
|
91
|
-
### Scrum Master (Historical)
|
|
92
|
-
|
|
93
|
-
**Purpose**: Multi-agent coordination, task management, sprint planning
|
|
94
|
-
|
|
95
|
-
Provided by `/sqlew` commands:
|
|
96
|
-
```bash
|
|
97
|
-
/sqlew plan <feature> # Replace: /sqw-scrum plan
|
|
98
|
-
/sqlew execute # Replace: /sqw-scrum implement
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Researcher (Historical)
|
|
102
|
-
|
|
103
|
-
**Purpose**: Query historical context, analyze patterns
|
|
104
|
-
|
|
105
|
-
Provided by `/sqlew` commands:
|
|
106
|
-
```bash
|
|
107
|
-
/sqlew search <topic> # Replace: /sqw-research
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Architect (Historical)
|
|
111
|
-
|
|
112
|
-
**Purpose**: Document decisions, enforce constraints
|
|
113
|
-
|
|
114
|
-
Provided by `/sqlew` commands:
|
|
115
|
-
```bash
|
|
116
|
-
/sqlew record <decision> # Replace: /sqw-secretary
|
|
117
|
-
/sqlew update <decision> # Replaces modifications
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
**Version**: 4.1.0
|
|
123
|
-
**Status**: Deprecated
|
|
124
|
-
**Last Updated**: 2025-12-04
|
|
125
|
-
|
|
126
|
-
See [SLASH_COMMANDS.md](SLASH_COMMANDS.md) for current documentation.
|