sqlew 3.2.5 → 3.5.3
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 +815 -13
- package/README.md +53 -2
- package/assets/schema.sql +6 -1
- package/dist/config/loader.d.ts +46 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +151 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/types.d.ts +77 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +28 -0
- package/dist/config/types.js.map +1 -0
- package/dist/constants.d.ts +9 -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.d.ts +1 -1
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +77 -10
- package/dist/database.js.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/migrations/add-v3.5.0-pruned-files.d.ts +26 -0
- package/dist/migrations/add-v3.5.0-pruned-files.d.ts.map +1 -0
- package/dist/migrations/add-v3.5.0-pruned-files.js +107 -0
- package/dist/migrations/add-v3.5.0-pruned-files.js.map +1 -0
- package/dist/migrations/index.d.ts +2 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +16 -1
- package/dist/migrations/index.js.map +1 -1
- package/dist/tests/git-aware-completion.test.d.ts +6 -0
- package/dist/tests/git-aware-completion.test.d.ts.map +1 -0
- package/dist/tests/git-aware-completion.test.js +141 -0
- package/dist/tests/git-aware-completion.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.d.ts +6 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.js +250 -0
- package/dist/tests/tasks.auto-pruning-decision-link.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-partial.test.d.ts +6 -0
- package/dist/tests/tasks.auto-pruning-partial.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-partial.test.js +274 -0
- package/dist/tests/tasks.auto-pruning-partial.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.d.ts +6 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.js +232 -0
- package/dist/tests/tasks.auto-pruning-persistence.test.js.map +1 -0
- package/dist/tests/tasks.auto-pruning-safety.test.d.ts +12 -0
- package/dist/tests/tasks.auto-pruning-safety.test.d.ts.map +1 -0
- package/dist/tests/tasks.auto-pruning-safety.test.js +196 -0
- package/dist/tests/tasks.auto-pruning-safety.test.js.map +1 -0
- package/dist/tests/tasks.link-file-backward-compat.test.d.ts +6 -0
- package/dist/tests/tasks.link-file-backward-compat.test.d.ts.map +1 -0
- package/dist/tests/tasks.link-file-backward-compat.test.js +235 -0
- package/dist/tests/tasks.link-file-backward-compat.test.js.map +1 -0
- package/dist/tests/tasks.watch-files-action.test.d.ts +6 -0
- package/dist/tests/tasks.watch-files-action.test.d.ts.map +1 -0
- package/dist/tests/tasks.watch-files-action.test.js +351 -0
- package/dist/tests/tasks.watch-files-action.test.js.map +1 -0
- package/dist/tests/tasks.watch-files-parameter.test.d.ts +6 -0
- package/dist/tests/tasks.watch-files-parameter.test.d.ts.map +1 -0
- package/dist/tests/tasks.watch-files-parameter.test.js +249 -0
- package/dist/tests/tasks.watch-files-parameter.test.js.map +1 -0
- package/dist/tests/two-step-git-completion.test.d.ts +6 -0
- package/dist/tests/two-step-git-completion.test.d.ts.map +1 -0
- package/dist/tests/two-step-git-completion.test.js +283 -0
- package/dist/tests/two-step-git-completion.test.js.map +1 -0
- package/dist/tests/vcs-staging.test.d.ts +6 -0
- package/dist/tests/vcs-staging.test.d.ts.map +1 -0
- package/dist/tests/vcs-staging.test.js +137 -0
- package/dist/tests/vcs-staging.test.js.map +1 -0
- package/dist/tools/config.d.ts +4 -2
- package/dist/tools/config.d.ts.map +1 -1
- package/dist/tools/config.js +13 -11
- package/dist/tools/config.js.map +1 -1
- package/dist/tools/constraints.d.ts +7 -4
- package/dist/tools/constraints.d.ts.map +1 -1
- package/dist/tools/constraints.js +19 -16
- package/dist/tools/constraints.js.map +1 -1
- package/dist/tools/context.d.ts +33 -17
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +84 -68
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/files.d.ts +9 -5
- package/dist/tools/files.d.ts.map +1 -1
- package/dist/tools/files.js +19 -15
- package/dist/tools/files.js.map +1 -1
- package/dist/tools/messaging.d.ts +9 -5
- package/dist/tools/messaging.d.ts.map +1 -1
- package/dist/tools/messaging.js +20 -16
- package/dist/tools/messaging.js.map +1 -1
- package/dist/tools/tasks.d.ts +40 -12
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +475 -87
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/utils.d.ts +11 -6
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +56 -44
- package/dist/tools/utils.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/file-pruning.d.ts +69 -0
- package/dist/utils/file-pruning.d.ts.map +1 -0
- package/dist/utils/file-pruning.js +185 -0
- package/dist/utils/file-pruning.js.map +1 -0
- package/dist/utils/quality-checks.d.ts +60 -0
- package/dist/utils/quality-checks.d.ts.map +1 -0
- package/dist/utils/quality-checks.js +228 -0
- package/dist/utils/quality-checks.js.map +1 -0
- package/dist/utils/retention.d.ts +8 -0
- package/dist/utils/retention.d.ts.map +1 -1
- package/dist/utils/retention.js +12 -0
- package/dist/utils/retention.js.map +1 -1
- package/dist/utils/task-stale-detection.d.ts +69 -1
- package/dist/utils/task-stale-detection.d.ts.map +1 -1
- package/dist/utils/task-stale-detection.js +494 -17
- package/dist/utils/task-stale-detection.js.map +1 -1
- package/dist/utils/vcs-adapter.d.ts +68 -0
- package/dist/utils/vcs-adapter.d.ts.map +1 -0
- package/dist/utils/vcs-adapter.js +187 -0
- package/dist/utils/vcs-adapter.js.map +1 -0
- package/dist/watcher/file-watcher.d.ts +54 -4
- package/dist/watcher/file-watcher.d.ts.map +1 -1
- package/dist/watcher/file-watcher.js +312 -30
- package/dist/watcher/file-watcher.js.map +1 -1
- package/dist/watcher/gitignore-parser.d.ts +70 -0
- package/dist/watcher/gitignore-parser.d.ts.map +1 -0
- package/dist/watcher/gitignore-parser.js +191 -0
- package/dist/watcher/gitignore-parser.js.map +1 -0
- package/dist/watcher/index.d.ts +1 -0
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js +1 -0
- package/dist/watcher/index.js.map +1 -1
- package/docs/AI_AGENT_GUIDE.md +1 -1
- package/docs/ARCHITECTURE.md +12 -0
- package/docs/AUTO_FILE_TRACKING.md +486 -82
- package/docs/CONFIGURATION.md +908 -0
- package/docs/GIT_AWARE_AUTO_COMPLETE.md +645 -0
- package/docs/MIGRATION_v3.3.md +602 -0
- package/docs/SHARED_CONCEPTS.md +2 -1
- package/docs/TASK_ACTIONS.md +12 -0
- package/docs/TASK_OVERVIEW.md +124 -23
- package/docs/TASK_PRUNING.md +589 -0
- package/docs/TASK_SYSTEM.md +83 -13
- package/docs/TOOL_REFERENCE.md +94 -6
- package/package.json +8 -6
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Task watch_files parameter feature (v3.4.1)
|
|
3
|
+
* Tests the new watch_files parameter in createTask and updateTask actions
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, beforeEach } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import Database from 'better-sqlite3';
|
|
8
|
+
import { initializeSchema } from '../schema.js';
|
|
9
|
+
import { getOrCreateAgent, getOrCreateFile } from '../database.js';
|
|
10
|
+
/**
|
|
11
|
+
* Test database instance
|
|
12
|
+
*/
|
|
13
|
+
let testDb;
|
|
14
|
+
/**
|
|
15
|
+
* Create an in-memory test database
|
|
16
|
+
*/
|
|
17
|
+
function createTestDatabase() {
|
|
18
|
+
const db = new Database(':memory:');
|
|
19
|
+
db.pragma('foreign_keys = ON');
|
|
20
|
+
initializeSchema(db);
|
|
21
|
+
return db;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Inline implementation of createTask with watch_files for testing
|
|
25
|
+
*/
|
|
26
|
+
function createTaskWithWatchFiles(db, params) {
|
|
27
|
+
const agentId = getOrCreateAgent(db, params.created_by_agent || 'system');
|
|
28
|
+
const statusId = 1; // todo
|
|
29
|
+
const result = db.prepare(`
|
|
30
|
+
INSERT INTO t_tasks (title, status_id, priority, created_by_agent_id, assigned_agent_id)
|
|
31
|
+
VALUES (?, ?, ?, ?, ?)
|
|
32
|
+
`).run(params.title, statusId, params.priority || 2, agentId, agentId);
|
|
33
|
+
const taskId = result.lastInsertRowid;
|
|
34
|
+
// Add description if provided
|
|
35
|
+
if (params.description || params.acceptance_criteria) {
|
|
36
|
+
db.prepare(`
|
|
37
|
+
INSERT INTO t_task_details (task_id, description, acceptance_criteria)
|
|
38
|
+
VALUES (?, ?, ?)
|
|
39
|
+
`).run(taskId, params.description || null, params.acceptance_criteria || null);
|
|
40
|
+
}
|
|
41
|
+
// Add tags if provided
|
|
42
|
+
if (params.tags && params.tags.length > 0) {
|
|
43
|
+
const insertTagLink = db.prepare('INSERT OR IGNORE INTO t_task_tags (task_id, tag_id) VALUES (?, ?)');
|
|
44
|
+
for (const tag of params.tags) {
|
|
45
|
+
db.prepare('INSERT OR IGNORE INTO m_tags (name) VALUES (?)').run(tag);
|
|
46
|
+
const tagResult = db.prepare('SELECT id FROM m_tags WHERE name = ?').get(tag);
|
|
47
|
+
insertTagLink.run(taskId, tagResult.id);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Add watch_files if provided
|
|
51
|
+
const watchedFiles = [];
|
|
52
|
+
if (params.watch_files && params.watch_files.length > 0) {
|
|
53
|
+
for (const filePath of params.watch_files) {
|
|
54
|
+
const fileId = getOrCreateFile(db, filePath);
|
|
55
|
+
db.prepare('INSERT OR IGNORE INTO t_task_file_links (task_id, file_id) VALUES (?, ?)')
|
|
56
|
+
.run(taskId, fileId);
|
|
57
|
+
watchedFiles.push(filePath);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
success: true,
|
|
62
|
+
task_id: taskId,
|
|
63
|
+
title: params.title,
|
|
64
|
+
status: 'todo',
|
|
65
|
+
...(watchedFiles.length > 0 && { watched_files: watchedFiles })
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Inline implementation of updateTask with watch_files for testing
|
|
70
|
+
*/
|
|
71
|
+
function updateTaskWithWatchFiles(db, params) {
|
|
72
|
+
const task = db.prepare('SELECT id FROM t_tasks WHERE id = ?').get(params.task_id);
|
|
73
|
+
if (!task) {
|
|
74
|
+
throw new Error(`Task #${params.task_id} not found`);
|
|
75
|
+
}
|
|
76
|
+
const watchedFiles = [];
|
|
77
|
+
if (params.watch_files && params.watch_files.length > 0) {
|
|
78
|
+
for (const filePath of params.watch_files) {
|
|
79
|
+
const fileId = getOrCreateFile(db, filePath);
|
|
80
|
+
db.prepare('INSERT OR IGNORE INTO t_task_file_links (task_id, file_id) VALUES (?, ?)')
|
|
81
|
+
.run(params.task_id, fileId);
|
|
82
|
+
watchedFiles.push(filePath);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
success: true,
|
|
87
|
+
task_id: params.task_id,
|
|
88
|
+
...(watchedFiles.length > 0 && { watched_files: watchedFiles })
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
describe('Task watch_files parameter tests', () => {
|
|
92
|
+
beforeEach(() => {
|
|
93
|
+
testDb = createTestDatabase();
|
|
94
|
+
});
|
|
95
|
+
it('should create task with watch_files parameter', () => {
|
|
96
|
+
const result = createTaskWithWatchFiles(testDb, {
|
|
97
|
+
title: 'Test Task with File Watching',
|
|
98
|
+
description: 'Testing watch_files parameter',
|
|
99
|
+
watch_files: ['src/index.ts', 'src/database.ts'],
|
|
100
|
+
created_by_agent: 'test-agent',
|
|
101
|
+
tags: ['test'],
|
|
102
|
+
priority: 2
|
|
103
|
+
});
|
|
104
|
+
assert.ok(result.success, 'Task creation should succeed');
|
|
105
|
+
assert.strictEqual(result.task_id, 1, 'First task should have ID 1');
|
|
106
|
+
assert.deepStrictEqual(result.watched_files, ['src/index.ts', 'src/database.ts'], 'Should return watched files list');
|
|
107
|
+
});
|
|
108
|
+
it('should link files in database', () => {
|
|
109
|
+
createTaskWithWatchFiles(testDb, {
|
|
110
|
+
title: 'Task with files',
|
|
111
|
+
watch_files: ['src/index.ts', 'src/database.ts']
|
|
112
|
+
});
|
|
113
|
+
const links = testDb.prepare(`
|
|
114
|
+
SELECT f.path
|
|
115
|
+
FROM t_task_file_links tfl
|
|
116
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
117
|
+
WHERE tfl.task_id = 1
|
|
118
|
+
ORDER BY f.path
|
|
119
|
+
`).all();
|
|
120
|
+
assert.strictEqual(links.length, 2, 'Should have 2 file links');
|
|
121
|
+
assert.strictEqual(links[0].path, 'src/database.ts');
|
|
122
|
+
assert.strictEqual(links[1].path, 'src/index.ts');
|
|
123
|
+
});
|
|
124
|
+
it('should register files in m_files table', () => {
|
|
125
|
+
createTaskWithWatchFiles(testDb, {
|
|
126
|
+
title: 'Task with files',
|
|
127
|
+
watch_files: ['src/index.ts', 'src/database.ts']
|
|
128
|
+
});
|
|
129
|
+
const files = testDb.prepare('SELECT path FROM m_files ORDER BY path').all();
|
|
130
|
+
assert.ok(files.length >= 2, 'Should have at least 2 files registered');
|
|
131
|
+
const paths = files.map(f => f.path);
|
|
132
|
+
assert.ok(paths.includes('src/index.ts'));
|
|
133
|
+
assert.ok(paths.includes('src/database.ts'));
|
|
134
|
+
});
|
|
135
|
+
it('should handle empty watch_files array', () => {
|
|
136
|
+
const result = createTaskWithWatchFiles(testDb, {
|
|
137
|
+
title: 'Task without file watching',
|
|
138
|
+
watch_files: []
|
|
139
|
+
});
|
|
140
|
+
assert.ok(result.success);
|
|
141
|
+
assert.strictEqual(result.watched_files, undefined, 'Should not have watched_files in response');
|
|
142
|
+
const links = testDb.prepare('SELECT * FROM t_task_file_links WHERE task_id = 1').all();
|
|
143
|
+
assert.strictEqual(links.length, 0, 'Should have no file links');
|
|
144
|
+
});
|
|
145
|
+
it('should handle missing watch_files parameter', () => {
|
|
146
|
+
const result = createTaskWithWatchFiles(testDb, {
|
|
147
|
+
title: 'Task without watch_files param'
|
|
148
|
+
});
|
|
149
|
+
assert.ok(result.success);
|
|
150
|
+
assert.strictEqual(result.watched_files, undefined, 'Should not have watched_files in response');
|
|
151
|
+
const links = testDb.prepare('SELECT * FROM t_task_file_links WHERE task_id = 1').all();
|
|
152
|
+
assert.strictEqual(links.length, 0, 'Should have no file links');
|
|
153
|
+
});
|
|
154
|
+
it('should update task to add watch_files', () => {
|
|
155
|
+
const task = createTaskWithWatchFiles(testDb, {
|
|
156
|
+
title: 'Task without files initially'
|
|
157
|
+
});
|
|
158
|
+
const result = updateTaskWithWatchFiles(testDb, {
|
|
159
|
+
task_id: task.task_id,
|
|
160
|
+
watch_files: ['src/tools/tasks.ts', 'src/schema.ts']
|
|
161
|
+
});
|
|
162
|
+
assert.ok(result.success);
|
|
163
|
+
assert.deepStrictEqual(result.watched_files, ['src/tools/tasks.ts', 'src/schema.ts']);
|
|
164
|
+
const links = testDb.prepare(`
|
|
165
|
+
SELECT f.path
|
|
166
|
+
FROM t_task_file_links tfl
|
|
167
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
168
|
+
WHERE tfl.task_id = ?
|
|
169
|
+
ORDER BY f.path
|
|
170
|
+
`).all(task.task_id);
|
|
171
|
+
assert.strictEqual(links.length, 2, 'Should have 2 file links after update');
|
|
172
|
+
});
|
|
173
|
+
it('should append new watch_files to existing ones', () => {
|
|
174
|
+
const task = createTaskWithWatchFiles(testDb, {
|
|
175
|
+
title: 'Task with initial files',
|
|
176
|
+
watch_files: ['src/index.ts', 'src/database.ts']
|
|
177
|
+
});
|
|
178
|
+
updateTaskWithWatchFiles(testDb, {
|
|
179
|
+
task_id: task.task_id,
|
|
180
|
+
watch_files: ['src/utils/validators.ts']
|
|
181
|
+
});
|
|
182
|
+
const links = testDb.prepare(`
|
|
183
|
+
SELECT f.path
|
|
184
|
+
FROM t_task_file_links tfl
|
|
185
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
186
|
+
WHERE tfl.task_id = ?
|
|
187
|
+
ORDER BY f.path
|
|
188
|
+
`).all(task.task_id);
|
|
189
|
+
assert.strictEqual(links.length, 3, 'Should have 3 file links total');
|
|
190
|
+
const paths = links.map(l => l.path);
|
|
191
|
+
assert.ok(paths.includes('src/index.ts'));
|
|
192
|
+
assert.ok(paths.includes('src/database.ts'));
|
|
193
|
+
assert.ok(paths.includes('src/utils/validators.ts'));
|
|
194
|
+
});
|
|
195
|
+
it('should handle duplicate file paths correctly (idempotent)', () => {
|
|
196
|
+
const task = createTaskWithWatchFiles(testDb, {
|
|
197
|
+
title: 'Task with files',
|
|
198
|
+
watch_files: ['src/index.ts']
|
|
199
|
+
});
|
|
200
|
+
updateTaskWithWatchFiles(testDb, {
|
|
201
|
+
task_id: task.task_id,
|
|
202
|
+
watch_files: ['src/index.ts'] // Duplicate
|
|
203
|
+
});
|
|
204
|
+
const links = testDb.prepare(`
|
|
205
|
+
SELECT f.path
|
|
206
|
+
FROM t_task_file_links tfl
|
|
207
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
208
|
+
WHERE tfl.task_id = ?
|
|
209
|
+
`).all(task.task_id);
|
|
210
|
+
assert.strictEqual(links.length, 1, 'Should not create duplicate links');
|
|
211
|
+
});
|
|
212
|
+
it('should handle various path formats', () => {
|
|
213
|
+
const result = createTaskWithWatchFiles(testDb, {
|
|
214
|
+
title: 'Task with various paths',
|
|
215
|
+
watch_files: [
|
|
216
|
+
'package.json',
|
|
217
|
+
'src/types.ts',
|
|
218
|
+
'docs/README.md'
|
|
219
|
+
]
|
|
220
|
+
});
|
|
221
|
+
assert.strictEqual(result.watched_files?.length, 3);
|
|
222
|
+
const links = testDb.prepare(`
|
|
223
|
+
SELECT f.path
|
|
224
|
+
FROM t_task_file_links tfl
|
|
225
|
+
JOIN m_files f ON tfl.file_id = f.id
|
|
226
|
+
WHERE tfl.task_id = ?
|
|
227
|
+
ORDER BY f.path
|
|
228
|
+
`).all(result.task_id);
|
|
229
|
+
assert.strictEqual(links.length, 3);
|
|
230
|
+
assert.strictEqual(links[0].path, 'docs/README.md');
|
|
231
|
+
assert.strictEqual(links[1].path, 'package.json');
|
|
232
|
+
assert.strictEqual(links[2].path, 'src/types.ts');
|
|
233
|
+
});
|
|
234
|
+
it('should work with acceptance_criteria', () => {
|
|
235
|
+
const result = createTaskWithWatchFiles(testDb, {
|
|
236
|
+
title: 'Task with auto-completion criteria',
|
|
237
|
+
acceptance_criteria: 'All tests passing',
|
|
238
|
+
watch_files: ['src/tests/tasks.watch-files-parameter.test.ts']
|
|
239
|
+
});
|
|
240
|
+
assert.ok(result.success);
|
|
241
|
+
assert.strictEqual(result.watched_files?.length, 1);
|
|
242
|
+
const details = testDb.prepare('SELECT acceptance_criteria FROM t_task_details WHERE task_id = ?')
|
|
243
|
+
.get(result.task_id);
|
|
244
|
+
assert.ok(details);
|
|
245
|
+
assert.strictEqual(details.acceptance_criteria, 'All tests passing');
|
|
246
|
+
});
|
|
247
|
+
console.log('\n✅ All watch_files parameter tests passed!\n');
|
|
248
|
+
});
|
|
249
|
+
//# sourceMappingURL=tasks.watch-files-parameter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.watch-files-parameter.test.js","sourceRoot":"","sources":["../../src/tests/tasks.watch-files-parameter.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EA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ion.test.d.ts","sourceRoot":"","sources":["../../src/tests/two-step-git-completion.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration Tests - Two-Step Git-Aware Task Workflow (v3.5.2)
|
|
3
|
+
* Tests the complete workflow: staging → done, commit → archived
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, before, after, beforeEach } from 'node:test';
|
|
6
|
+
import assert from 'node:assert';
|
|
7
|
+
import Database from 'better-sqlite3';
|
|
8
|
+
import { unlinkSync, existsSync, mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
9
|
+
import { join } from 'path';
|
|
10
|
+
import { execSync } from 'child_process';
|
|
11
|
+
import { initializeSchema } from '../schema.js';
|
|
12
|
+
import { detectAndCompleteOnStaging, detectAndArchiveOnCommit } from '../utils/task-stale-detection.js';
|
|
13
|
+
const TEST_DB_PATH = join(process.cwd(), 'test-two-step-workflow.db');
|
|
14
|
+
const TEST_DIR = join(process.cwd(), 'test-two-step-git');
|
|
15
|
+
// Helper to clean up test database
|
|
16
|
+
function cleanupTestDb() {
|
|
17
|
+
if (existsSync(TEST_DB_PATH)) {
|
|
18
|
+
unlinkSync(TEST_DB_PATH);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// Helper to clean up test directory
|
|
22
|
+
function cleanupTestDir() {
|
|
23
|
+
if (existsSync(TEST_DIR)) {
|
|
24
|
+
rmSync(TEST_DIR, { recursive: true, force: true });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
describe('Two-Step Git-Aware Workflow Integration Tests', () => {
|
|
28
|
+
let db;
|
|
29
|
+
before(() => {
|
|
30
|
+
// Clean up before tests
|
|
31
|
+
cleanupTestDb();
|
|
32
|
+
cleanupTestDir();
|
|
33
|
+
// Create test database
|
|
34
|
+
db = new Database(TEST_DB_PATH);
|
|
35
|
+
db.pragma('foreign_keys = ON');
|
|
36
|
+
// Initialize schema
|
|
37
|
+
initializeSchema(db);
|
|
38
|
+
// Create 'system' agent (required for activity log triggers)
|
|
39
|
+
db.prepare('INSERT INTO m_agents (name) VALUES (?)').run('system');
|
|
40
|
+
// Add test config for two-step workflow
|
|
41
|
+
db.prepare('INSERT OR REPLACE INTO m_config (key, value) VALUES (?, ?)').run('git_auto_complete_on_stage', '1');
|
|
42
|
+
db.prepare('INSERT OR REPLACE INTO m_config (key, value) VALUES (?, ?)').run('git_auto_archive_on_commit', '1');
|
|
43
|
+
db.prepare('INSERT OR REPLACE INTO m_config (key, value) VALUES (?, ?)').run('require_all_files_staged', '1');
|
|
44
|
+
db.prepare('INSERT OR REPLACE INTO m_config (key, value) VALUES (?, ?)').run('require_all_files_committed_for_archive', '1');
|
|
45
|
+
// Create test git repository
|
|
46
|
+
mkdirSync(TEST_DIR, { recursive: true });
|
|
47
|
+
execSync('git init', { cwd: TEST_DIR });
|
|
48
|
+
execSync('git config user.email "test@example.com"', { cwd: TEST_DIR });
|
|
49
|
+
execSync('git config user.name "Test User"', { cwd: TEST_DIR });
|
|
50
|
+
// Change to test directory for git operations
|
|
51
|
+
process.chdir(TEST_DIR);
|
|
52
|
+
});
|
|
53
|
+
after(() => {
|
|
54
|
+
// Close database
|
|
55
|
+
if (db) {
|
|
56
|
+
db.close();
|
|
57
|
+
}
|
|
58
|
+
// Go back to original directory
|
|
59
|
+
process.chdir(join(TEST_DIR, '..'));
|
|
60
|
+
// Clean up test database and directory
|
|
61
|
+
cleanupTestDb();
|
|
62
|
+
cleanupTestDir();
|
|
63
|
+
});
|
|
64
|
+
describe('Step 1: Staging → Done', () => {
|
|
65
|
+
beforeEach(() => {
|
|
66
|
+
// Clean up tasks and file links from previous tests
|
|
67
|
+
db.prepare('DELETE FROM t_task_file_links').run();
|
|
68
|
+
db.prepare('DELETE FROM t_tasks').run();
|
|
69
|
+
});
|
|
70
|
+
it('should transition task from waiting_review to done when all files staged', async () => {
|
|
71
|
+
// 1. Create task in waiting_review with watched file
|
|
72
|
+
const agentId = db.prepare('INSERT INTO m_agents (name) VALUES (?)').run('test-agent').lastInsertRowid;
|
|
73
|
+
const statusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('waiting_review');
|
|
74
|
+
const taskId = db.prepare(`
|
|
75
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
76
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
77
|
+
`).run(agentId, statusId.id).lastInsertRowid;
|
|
78
|
+
// 2. Add watched file
|
|
79
|
+
writeFileSync('test-file1.ts', '// Test content');
|
|
80
|
+
const fileId = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('test-file1.ts').lastInsertRowid;
|
|
81
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, fileId);
|
|
82
|
+
// 3. Stage the file
|
|
83
|
+
execSync('git add test-file1.ts');
|
|
84
|
+
// 4. Run staging detection
|
|
85
|
+
const completedCount = await detectAndCompleteOnStaging(db);
|
|
86
|
+
// 5. Verify task transitioned to done
|
|
87
|
+
assert.strictEqual(completedCount, 1, 'Should complete 1 task');
|
|
88
|
+
const task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
89
|
+
const doneStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('done');
|
|
90
|
+
assert.strictEqual(task.status_id, doneStatusId.id, 'Task should be in done status');
|
|
91
|
+
});
|
|
92
|
+
it('should NOT transition when only some files are staged', async () => {
|
|
93
|
+
// 1. Create task with 2 watched files
|
|
94
|
+
const agentId = db.prepare('SELECT id FROM m_agents WHERE name = ?').get('test-agent');
|
|
95
|
+
const statusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('waiting_review');
|
|
96
|
+
const taskId = db.prepare(`
|
|
97
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
98
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
99
|
+
`).run(agentId.id, statusId.id).lastInsertRowid;
|
|
100
|
+
// 2. Add 2 watched files
|
|
101
|
+
writeFileSync('test-file2.ts', '// Test content 2');
|
|
102
|
+
writeFileSync('test-file3.ts', '// Test content 3');
|
|
103
|
+
const file2Id = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('test-file2.ts').lastInsertRowid;
|
|
104
|
+
const file3Id = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('test-file3.ts').lastInsertRowid;
|
|
105
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, file2Id);
|
|
106
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, file3Id);
|
|
107
|
+
// 3. Stage only ONE file
|
|
108
|
+
execSync('git add test-file2.ts');
|
|
109
|
+
// 4. Run staging detection
|
|
110
|
+
const completedCount = await detectAndCompleteOnStaging(db);
|
|
111
|
+
// 5. Verify task is STILL in waiting_review
|
|
112
|
+
assert.strictEqual(completedCount, 0, 'Should NOT complete any tasks');
|
|
113
|
+
const task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
114
|
+
assert.strictEqual(task.status_id, statusId.id, 'Task should still be in waiting_review');
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
describe('Step 2: Commit → Archived', () => {
|
|
118
|
+
beforeEach(() => {
|
|
119
|
+
// Clean up tasks and file links from previous tests
|
|
120
|
+
db.prepare('DELETE FROM t_task_file_links').run();
|
|
121
|
+
db.prepare('DELETE FROM t_tasks').run();
|
|
122
|
+
});
|
|
123
|
+
it('should transition task from done to archived when all files committed', async () => {
|
|
124
|
+
// 1. Commit previously staged files
|
|
125
|
+
execSync('git commit -m "Test commit 1"');
|
|
126
|
+
// 2. Create task in done status with watched file
|
|
127
|
+
const agentId = db.prepare('SELECT id FROM m_agents WHERE name = ?').get('test-agent');
|
|
128
|
+
const doneStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('done');
|
|
129
|
+
const taskId = db.prepare(`
|
|
130
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
131
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
132
|
+
`).run(agentId.id, doneStatusId.id).lastInsertRowid;
|
|
133
|
+
// 3. Add watched file and commit it
|
|
134
|
+
writeFileSync('test-file4.ts', '// Test content 4');
|
|
135
|
+
const fileId = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('test-file4.ts').lastInsertRowid;
|
|
136
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, fileId);
|
|
137
|
+
execSync('git add test-file4.ts');
|
|
138
|
+
execSync('git commit -m "Test commit 2"');
|
|
139
|
+
// 4. Run archive detection
|
|
140
|
+
const archivedCount = await detectAndArchiveOnCommit(db);
|
|
141
|
+
// 5. Verify task transitioned to archived
|
|
142
|
+
assert.strictEqual(archivedCount, 1, 'Should archive 1 task');
|
|
143
|
+
const task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
144
|
+
const archivedStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('archived');
|
|
145
|
+
assert.strictEqual(task.status_id, archivedStatusId.id, 'Task should be in archived status');
|
|
146
|
+
});
|
|
147
|
+
it('should NOT archive when files are not committed (only staged)', async () => {
|
|
148
|
+
// 1. Create task in done status
|
|
149
|
+
const agentId = db.prepare('SELECT id FROM m_agents WHERE name = ?').get('test-agent');
|
|
150
|
+
const doneStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('done');
|
|
151
|
+
const taskId = db.prepare(`
|
|
152
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
153
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
154
|
+
`).run(agentId.id, doneStatusId.id).lastInsertRowid;
|
|
155
|
+
// 2. Add watched file and ONLY stage it (don't commit)
|
|
156
|
+
writeFileSync('test-file5.ts', '// Test content 5');
|
|
157
|
+
const fileId = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('test-file5.ts').lastInsertRowid;
|
|
158
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, fileId);
|
|
159
|
+
execSync('git add test-file5.ts');
|
|
160
|
+
// 3. Run archive detection
|
|
161
|
+
const archivedCount = await detectAndArchiveOnCommit(db);
|
|
162
|
+
// 4. Verify task is STILL in done
|
|
163
|
+
assert.strictEqual(archivedCount, 0, 'Should NOT archive any tasks');
|
|
164
|
+
const task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
165
|
+
assert.strictEqual(task.status_id, doneStatusId.id, 'Task should still be in done status');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
describe('Full Two-Step Workflow', () => {
|
|
169
|
+
beforeEach(() => {
|
|
170
|
+
// Clean up tasks and file links from previous tests
|
|
171
|
+
db.prepare('DELETE FROM t_task_file_links').run();
|
|
172
|
+
db.prepare('DELETE FROM t_tasks').run();
|
|
173
|
+
});
|
|
174
|
+
it('should complete full cycle: waiting_review → done → archived', async () => {
|
|
175
|
+
// 1. Create task in waiting_review
|
|
176
|
+
const agentId = db.prepare('SELECT id FROM m_agents WHERE name = ?').get('test-agent');
|
|
177
|
+
const waitingReviewId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('waiting_review');
|
|
178
|
+
const taskId = db.prepare(`
|
|
179
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
180
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
181
|
+
`).run(agentId.id, waitingReviewId.id).lastInsertRowid;
|
|
182
|
+
// 2. Add watched file
|
|
183
|
+
writeFileSync('test-full-cycle.ts', '// Full cycle test');
|
|
184
|
+
const fileId = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('test-full-cycle.ts').lastInsertRowid;
|
|
185
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, fileId);
|
|
186
|
+
// 3. STEP 1: Stage file → should transition to done
|
|
187
|
+
execSync('git add test-full-cycle.ts');
|
|
188
|
+
const stagingCompleted = await detectAndCompleteOnStaging(db);
|
|
189
|
+
assert.strictEqual(stagingCompleted, 1);
|
|
190
|
+
let task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
191
|
+
const doneStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('done');
|
|
192
|
+
assert.strictEqual(task.status_id, doneStatusId.id, 'Task should be done after staging');
|
|
193
|
+
// 4. STEP 2: Commit file → should transition to archived
|
|
194
|
+
execSync('git commit -m "Full cycle test"');
|
|
195
|
+
const commitArchived = await detectAndArchiveOnCommit(db);
|
|
196
|
+
assert.strictEqual(commitArchived, 1);
|
|
197
|
+
task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
198
|
+
const archivedStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('archived');
|
|
199
|
+
assert.strictEqual(task.status_id, archivedStatusId.id, 'Task should be archived after commit');
|
|
200
|
+
});
|
|
201
|
+
it('should handle rapid staging + commit (git commit -a)', async () => {
|
|
202
|
+
// 1. Create task
|
|
203
|
+
const agentId = db.prepare('SELECT id FROM m_agents WHERE name = ?').get('test-agent');
|
|
204
|
+
const waitingReviewId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('waiting_review');
|
|
205
|
+
const taskId = db.prepare(`
|
|
206
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
207
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
208
|
+
`).run(agentId.id, waitingReviewId.id).lastInsertRowid;
|
|
209
|
+
// 2. Add watched file
|
|
210
|
+
writeFileSync('test-rapid.ts', '// Rapid test');
|
|
211
|
+
const fileId = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('test-rapid.ts').lastInsertRowid;
|
|
212
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, fileId);
|
|
213
|
+
// 3. Stage and commit immediately
|
|
214
|
+
execSync('git add test-rapid.ts && git commit -m "Rapid test"');
|
|
215
|
+
// 4. Run both detections - should go straight to archived
|
|
216
|
+
const stagingCompleted = await detectAndCompleteOnStaging(db);
|
|
217
|
+
// Staging won't find it (already committed)
|
|
218
|
+
assert.strictEqual(stagingCompleted, 0);
|
|
219
|
+
// But commit detection should complete it to done first
|
|
220
|
+
// This is handled by detectAndCompleteReviewedTasks in real workflow
|
|
221
|
+
// For this test, manually transition to done then test archiving
|
|
222
|
+
const doneStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('done');
|
|
223
|
+
db.prepare('UPDATE t_tasks SET status_id = ? WHERE id = ?').run(doneStatusId.id, taskId);
|
|
224
|
+
const commitArchived = await detectAndArchiveOnCommit(db);
|
|
225
|
+
assert.strictEqual(commitArchived, 1);
|
|
226
|
+
const task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
227
|
+
const archivedStatusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('archived');
|
|
228
|
+
assert.strictEqual(task.status_id, archivedStatusId.id);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
describe('Configuration Tests', () => {
|
|
232
|
+
beforeEach(() => {
|
|
233
|
+
// Clean up tasks and file links from previous tests
|
|
234
|
+
db.prepare('DELETE FROM t_task_file_links').run();
|
|
235
|
+
db.prepare('DELETE FROM t_tasks').run();
|
|
236
|
+
});
|
|
237
|
+
it('should respect require_all_files_staged config', async () => {
|
|
238
|
+
// Set to require all files
|
|
239
|
+
db.prepare('UPDATE m_config SET value = ? WHERE key = ?').run('1', 'require_all_files_staged');
|
|
240
|
+
// Create task with 2 files
|
|
241
|
+
const agentId = db.prepare('SELECT id FROM m_agents WHERE name = ?').get('test-agent');
|
|
242
|
+
const statusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('waiting_review');
|
|
243
|
+
const taskId = db.prepare(`
|
|
244
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
245
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
246
|
+
`).run(agentId.id, statusId.id).lastInsertRowid;
|
|
247
|
+
writeFileSync('config-test1.ts', '// Config test 1');
|
|
248
|
+
writeFileSync('config-test2.ts', '// Config test 2');
|
|
249
|
+
const file1Id = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('config-test1.ts').lastInsertRowid;
|
|
250
|
+
const file2Id = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('config-test2.ts').lastInsertRowid;
|
|
251
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, file1Id);
|
|
252
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, file2Id);
|
|
253
|
+
// Stage only one file
|
|
254
|
+
execSync('git add config-test1.ts');
|
|
255
|
+
// Should NOT complete (require ALL)
|
|
256
|
+
const completed = await detectAndCompleteOnStaging(db);
|
|
257
|
+
assert.strictEqual(completed, 0);
|
|
258
|
+
const task = db.prepare('SELECT status_id FROM t_tasks WHERE id = ?').get(taskId);
|
|
259
|
+
assert.strictEqual(task.status_id, statusId.id, 'Task should still be waiting_review');
|
|
260
|
+
});
|
|
261
|
+
it('should respect git_auto_complete_on_stage disabled', async () => {
|
|
262
|
+
// Disable staging auto-complete
|
|
263
|
+
db.prepare('UPDATE m_config SET value = ? WHERE key = ?').run('0', 'git_auto_complete_on_stage');
|
|
264
|
+
// Create and stage task
|
|
265
|
+
const agentId = db.prepare('SELECT id FROM m_agents WHERE name = ?').get('test-agent');
|
|
266
|
+
const statusId = db.prepare('SELECT id FROM m_task_statuses WHERE name = ?').get('waiting_review');
|
|
267
|
+
const taskId = db.prepare(`
|
|
268
|
+
INSERT INTO t_tasks (title, assigned_agent_id, status_id, priority, created_ts, updated_ts)
|
|
269
|
+
VALUES ('Test task', ?, ?, 2, unixepoch(), unixepoch())
|
|
270
|
+
`).run(agentId.id, statusId.id).lastInsertRowid;
|
|
271
|
+
writeFileSync('disabled-test.ts', '// Disabled test');
|
|
272
|
+
const fileId = db.prepare('INSERT INTO m_files (path) VALUES (?)').run('disabled-test.ts').lastInsertRowid;
|
|
273
|
+
db.prepare('INSERT INTO t_task_file_links (task_id, file_id) VALUES (?, ?)').run(taskId, fileId);
|
|
274
|
+
execSync('git add disabled-test.ts');
|
|
275
|
+
// Should NOT complete (feature disabled)
|
|
276
|
+
const completed = await detectAndCompleteOnStaging(db);
|
|
277
|
+
assert.strictEqual(completed, 0);
|
|
278
|
+
// Re-enable for other tests
|
|
279
|
+
db.prepare('UPDATE m_config SET value = ? WHERE key = ?').run('1', 'git_auto_complete_on_stage');
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
//# sourceMappingURL=two-step-git-completion.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"two-step-git-completion.test.js","sourceRoot":"","sources":["../../src/tests/two-step-git-completion.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO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