@schnick371/devsteps-shared 0.7.0-next.2 → 0.7.0-next.4
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/dist/constants/index.d.ts +78 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +70 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/core/auto-migrate.d.ts +154 -0
- package/dist/core/auto-migrate.d.ts.map +1 -0
- package/dist/core/auto-migrate.js +383 -0
- package/dist/core/auto-migrate.js.map +1 -0
- package/dist/core/auto-migrate.test.d.ts +7 -0
- package/dist/core/auto-migrate.test.d.ts.map +1 -0
- package/dist/core/auto-migrate.test.js +364 -0
- package/dist/core/auto-migrate.test.js.map +1 -0
- package/dist/core/index-rebuild.d.ts +75 -0
- package/dist/core/index-rebuild.d.ts.map +1 -0
- package/dist/core/index-rebuild.js +260 -0
- package/dist/core/index-rebuild.js.map +1 -0
- package/dist/core/index-rebuild.test.d.ts +8 -0
- package/dist/core/index-rebuild.test.d.ts.map +1 -0
- package/dist/core/index-rebuild.test.js +582 -0
- package/dist/core/index-rebuild.test.js.map +1 -0
- package/dist/core/index-refs.d.ts +155 -0
- package/dist/core/index-refs.d.ts.map +1 -0
- package/dist/core/index-refs.js +442 -0
- package/dist/core/index-refs.js.map +1 -0
- package/dist/core/index-refs.test.d.ts +7 -0
- package/dist/core/index-refs.test.d.ts.map +1 -0
- package/dist/core/index-refs.test.js +367 -0
- package/dist/core/index-refs.test.js.map +1 -0
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +6 -5
- package/dist/core/update.js.map +1 -1
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +29 -28
- package/dist/core/validation.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/migration/fix-missing-eisenhower.d.ts +8 -0
- package/dist/migration/fix-missing-eisenhower.d.ts.map +1 -0
- package/dist/migration/fix-missing-eisenhower.js +58 -0
- package/dist/migration/fix-missing-eisenhower.js.map +1 -0
- package/dist/migration/remove-priority-field.d.ts +15 -0
- package/dist/migration/remove-priority-field.d.ts.map +1 -0
- package/dist/migration/remove-priority-field.js +113 -0
- package/dist/migration/remove-priority-field.js.map +1 -0
- package/dist/schemas/index-refs.schema.d.ts +103 -0
- package/dist/schemas/index-refs.schema.d.ts.map +1 -0
- package/dist/schemas/index-refs.schema.js +88 -0
- package/dist/schemas/index-refs.schema.js.map +1 -0
- package/dist/types/index-refs.types.d.ts +123 -0
- package/dist/types/index-refs.types.d.ts.map +1 -0
- package/dist/types/index-refs.types.js +71 -0
- package/dist/types/index-refs.types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refs-Style Index Core Operations
|
|
3
|
+
*
|
|
4
|
+
* Git-inspired distributed index implementation with atomic operations
|
|
5
|
+
* and consistency guarantees across all index files.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* - `.devsteps/index/by-type/*.json` - Type categorization
|
|
9
|
+
* - `.devsteps/index/by-status/*.json` - Status filtering
|
|
10
|
+
* - `.devsteps/index/by-priority/*.json` - Priority queries
|
|
11
|
+
* - `.devsteps/index/counters.json` - ID generation state
|
|
12
|
+
*
|
|
13
|
+
* Benefits:
|
|
14
|
+
* - Zero merge conflicts (separate files)
|
|
15
|
+
* - Faster queries (load only needed index)
|
|
16
|
+
* - Atomic updates per category
|
|
17
|
+
* - Better scalability
|
|
18
|
+
*
|
|
19
|
+
* @see EPIC-018 Index Architecture Refactoring
|
|
20
|
+
* @see STORY-069 Foundation: Refs-Style Index Schema
|
|
21
|
+
*/
|
|
22
|
+
import type { EisenhowerQuadrant, ItemMetadata, ItemStatus, ItemType } from '../schemas/index.js';
|
|
23
|
+
import type { IndexPaths, RefsStyleIndex } from '../types/index-refs.types.js';
|
|
24
|
+
/**
|
|
25
|
+
* Get index directory paths for a DevSteps project
|
|
26
|
+
*/
|
|
27
|
+
export declare function getIndexPaths(devstepsDir: string): IndexPaths;
|
|
28
|
+
/**
|
|
29
|
+
* Check if refs-style index structure exists
|
|
30
|
+
*/
|
|
31
|
+
export declare function hasRefsStyleIndex(devstepsDir: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Check if legacy index.json exists (migration detection)
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasLegacyIndex(devstepsDir: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Initialize refs-style index directory structure
|
|
38
|
+
*
|
|
39
|
+
* Creates:
|
|
40
|
+
* - .devsteps/index/by-type/
|
|
41
|
+
* - .devsteps/index/by-status/
|
|
42
|
+
* - .devsteps/index/by-priority/
|
|
43
|
+
* - .devsteps/index/counters.json
|
|
44
|
+
*
|
|
45
|
+
* @param devstepsDir Path to .devsteps directory
|
|
46
|
+
* @param initialCounters Optional initial counters (for migration)
|
|
47
|
+
*/
|
|
48
|
+
export declare function initializeRefsStyleIndex(devstepsDir: string, initialCounters?: Record<string, number>): void;
|
|
49
|
+
/**
|
|
50
|
+
* Load index by item type
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const taskIds = await loadIndexByType(devstepsDir, 'task');
|
|
55
|
+
* // Returns: ['TASK-160', 'TASK-161', 'TASK-162']
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function loadIndexByType(devstepsDir: string, type: ItemType): string[];
|
|
59
|
+
/**
|
|
60
|
+
* Load index by item status
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const draftIds = await loadIndexByStatus(devstepsDir, 'draft');
|
|
65
|
+
* // Returns: ['STORY-069', 'TASK-198', ...]
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare function loadIndexByStatus(devstepsDir: string, status: ItemStatus): string[];
|
|
69
|
+
/**
|
|
70
|
+
* Load index by priority (Eisenhower quadrant)
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const urgentIds = await loadIndexByPriority(devstepsDir, 'urgent-important');
|
|
75
|
+
* // Returns Q1 items
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function loadIndexByPriority(devstepsDir: string, priority: EisenhowerQuadrant): string[];
|
|
79
|
+
/**
|
|
80
|
+
* Load all indexes into memory
|
|
81
|
+
*
|
|
82
|
+
* Useful for operations that need complete index access.
|
|
83
|
+
* For most queries, prefer loading only the needed index.
|
|
84
|
+
*/
|
|
85
|
+
export declare function loadAllIndexes(devstepsDir: string): RefsStyleIndex;
|
|
86
|
+
/**
|
|
87
|
+
* Load ID generation counters
|
|
88
|
+
*/
|
|
89
|
+
export declare function loadCounters(devstepsDir: string): Record<string, number>;
|
|
90
|
+
/**
|
|
91
|
+
* Update type index
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* updateIndexByType(devstepsDir, 'task', ['TASK-160', 'TASK-161', 'TASK-162']);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function updateIndexByType(devstepsDir: string, type: ItemType, items: string[]): void;
|
|
99
|
+
/**
|
|
100
|
+
* Update status index
|
|
101
|
+
*/
|
|
102
|
+
export declare function updateIndexByStatus(devstepsDir: string, status: ItemStatus, items: string[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Update priority index
|
|
105
|
+
*/
|
|
106
|
+
export declare function updateIndexByPriority(devstepsDir: string, priority: EisenhowerQuadrant, items: string[]): void;
|
|
107
|
+
/**
|
|
108
|
+
* Update counters file
|
|
109
|
+
*/
|
|
110
|
+
export declare function updateCounters(devstepsDir: string, counters: Record<string, number>): void;
|
|
111
|
+
/**
|
|
112
|
+
* Add item to all relevant indexes
|
|
113
|
+
*
|
|
114
|
+
* Ensures consistency: item appears in exactly one index per dimension
|
|
115
|
+
*
|
|
116
|
+
* @param devstepsDir Path to .devsteps directory
|
|
117
|
+
* @param item Item metadata
|
|
118
|
+
*/
|
|
119
|
+
export declare function addItemToIndex(devstepsDir: string, item: ItemMetadata): void;
|
|
120
|
+
/**
|
|
121
|
+
* Remove item from all indexes
|
|
122
|
+
*
|
|
123
|
+
* @param devstepsDir Path to .devsteps directory
|
|
124
|
+
* @param itemId Item ID to remove
|
|
125
|
+
* @param type Item type (for efficient lookup)
|
|
126
|
+
* @param status Item status (for efficient lookup)
|
|
127
|
+
* @param priority Item priority (for efficient lookup)
|
|
128
|
+
*/
|
|
129
|
+
export declare function removeItemFromIndex(devstepsDir: string, itemId: string, type?: ItemType, status?: ItemStatus, priority?: EisenhowerQuadrant): void;
|
|
130
|
+
/**
|
|
131
|
+
* Update item in indexes (when status/priority changes)
|
|
132
|
+
*
|
|
133
|
+
* @param devstepsDir Path to .devsteps directory
|
|
134
|
+
* @param itemId Item ID
|
|
135
|
+
* @param oldStatus Previous status (to remove from old index)
|
|
136
|
+
* @param newStatus New status (to add to new index)
|
|
137
|
+
* @param oldPriority Previous priority
|
|
138
|
+
* @param newPriority New priority
|
|
139
|
+
*/
|
|
140
|
+
export declare function updateItemInIndex(devstepsDir: string, itemId: string, oldStatus?: ItemStatus, newStatus?: ItemStatus, oldPriority?: EisenhowerQuadrant, newPriority?: EisenhowerQuadrant): void;
|
|
141
|
+
/**
|
|
142
|
+
* Load legacy index.json (for migration/fallback)
|
|
143
|
+
*
|
|
144
|
+
* @deprecated Use refs-style index operations instead
|
|
145
|
+
*/
|
|
146
|
+
export declare function loadLegacyIndex(devstepsDir: string): {
|
|
147
|
+
items: Array<{
|
|
148
|
+
id: string;
|
|
149
|
+
type: ItemType;
|
|
150
|
+
status: ItemStatus;
|
|
151
|
+
eisenhower?: EisenhowerQuadrant;
|
|
152
|
+
}>;
|
|
153
|
+
counters: Record<string, number>;
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=index-refs.d.ts.map
|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AC,UAAU,CAAC,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAClG,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CASA"}
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refs-Style Index Core Operations
|
|
3
|
+
*
|
|
4
|
+
* Git-inspired distributed index implementation with atomic operations
|
|
5
|
+
* and consistency guarantees across all index files.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* - `.devsteps/index/by-type/*.json` - Type categorization
|
|
9
|
+
* - `.devsteps/index/by-status/*.json` - Status filtering
|
|
10
|
+
* - `.devsteps/index/by-priority/*.json` - Priority queries
|
|
11
|
+
* - `.devsteps/index/counters.json` - ID generation state
|
|
12
|
+
*
|
|
13
|
+
* Benefits:
|
|
14
|
+
* - Zero merge conflicts (separate files)
|
|
15
|
+
* - Faster queries (load only needed index)
|
|
16
|
+
* - Atomic updates per category
|
|
17
|
+
* - Better scalability
|
|
18
|
+
*
|
|
19
|
+
* @see EPIC-018 Index Architecture Refactoring
|
|
20
|
+
* @see STORY-069 Foundation: Refs-Style Index Schema
|
|
21
|
+
*/
|
|
22
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
23
|
+
import { join } from 'node:path';
|
|
24
|
+
import { CountersSchema, validateCategoryIndex, validateCounters, } from '../schemas/index-refs.schema.js';
|
|
25
|
+
import { INDEX_FILENAMES } from '../types/index-refs.types.js';
|
|
26
|
+
import { getCurrentTimestamp } from '../utils/index.js';
|
|
27
|
+
/**
|
|
28
|
+
* Get index directory paths for a DevSteps project
|
|
29
|
+
*/
|
|
30
|
+
export function getIndexPaths(devstepsDir) {
|
|
31
|
+
const indexRoot = join(devstepsDir, 'index');
|
|
32
|
+
return {
|
|
33
|
+
root: indexRoot,
|
|
34
|
+
byType: join(indexRoot, 'by-type'),
|
|
35
|
+
byStatus: join(indexRoot, 'by-status'),
|
|
36
|
+
byPriority: join(indexRoot, 'by-priority'),
|
|
37
|
+
counters: join(indexRoot, 'counters.json'),
|
|
38
|
+
legacy: join(devstepsDir, 'index.json'),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Check if refs-style index structure exists
|
|
43
|
+
*/
|
|
44
|
+
export function hasRefsStyleIndex(devstepsDir) {
|
|
45
|
+
const paths = getIndexPaths(devstepsDir);
|
|
46
|
+
return (existsSync(paths.root) &&
|
|
47
|
+
existsSync(paths.byType) &&
|
|
48
|
+
existsSync(paths.byStatus) &&
|
|
49
|
+
existsSync(paths.byPriority) &&
|
|
50
|
+
existsSync(paths.counters));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Check if legacy index.json exists (migration detection)
|
|
54
|
+
*/
|
|
55
|
+
export function hasLegacyIndex(devstepsDir) {
|
|
56
|
+
const paths = getIndexPaths(devstepsDir);
|
|
57
|
+
return existsSync(paths.legacy);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Initialize refs-style index directory structure
|
|
61
|
+
*
|
|
62
|
+
* Creates:
|
|
63
|
+
* - .devsteps/index/by-type/
|
|
64
|
+
* - .devsteps/index/by-status/
|
|
65
|
+
* - .devsteps/index/by-priority/
|
|
66
|
+
* - .devsteps/index/counters.json
|
|
67
|
+
*
|
|
68
|
+
* @param devstepsDir Path to .devsteps directory
|
|
69
|
+
* @param initialCounters Optional initial counters (for migration)
|
|
70
|
+
*/
|
|
71
|
+
export function initializeRefsStyleIndex(devstepsDir, initialCounters = {}) {
|
|
72
|
+
const paths = getIndexPaths(devstepsDir);
|
|
73
|
+
// Create directory structure
|
|
74
|
+
mkdirSync(paths.root, { recursive: true });
|
|
75
|
+
mkdirSync(paths.byType, { recursive: true });
|
|
76
|
+
mkdirSync(paths.byStatus, { recursive: true });
|
|
77
|
+
mkdirSync(paths.byPriority, { recursive: true });
|
|
78
|
+
// Initialize counters
|
|
79
|
+
const counters = CountersSchema.parse(initialCounters);
|
|
80
|
+
writeFileSync(paths.counters, JSON.stringify(counters, null, 2));
|
|
81
|
+
// Create empty index files for all categories
|
|
82
|
+
const now = getCurrentTimestamp();
|
|
83
|
+
// Type indexes
|
|
84
|
+
for (const [type, filename] of Object.entries(INDEX_FILENAMES.TYPE)) {
|
|
85
|
+
const indexPath = join(paths.byType, filename);
|
|
86
|
+
if (!existsSync(indexPath)) {
|
|
87
|
+
const emptyIndex = {
|
|
88
|
+
category: type,
|
|
89
|
+
items: [],
|
|
90
|
+
updated: now,
|
|
91
|
+
};
|
|
92
|
+
writeFileSync(indexPath, JSON.stringify(emptyIndex, null, 2));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Status indexes
|
|
96
|
+
for (const [status, filename] of Object.entries(INDEX_FILENAMES.STATUS)) {
|
|
97
|
+
const indexPath = join(paths.byStatus, filename);
|
|
98
|
+
if (!existsSync(indexPath)) {
|
|
99
|
+
const emptyIndex = {
|
|
100
|
+
category: status,
|
|
101
|
+
items: [],
|
|
102
|
+
updated: now,
|
|
103
|
+
};
|
|
104
|
+
writeFileSync(indexPath, JSON.stringify(emptyIndex, null, 2));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Priority indexes
|
|
108
|
+
for (const [priority, filename] of Object.entries(INDEX_FILENAMES.PRIORITY)) {
|
|
109
|
+
const indexPath = join(paths.byPriority, filename);
|
|
110
|
+
if (!existsSync(indexPath)) {
|
|
111
|
+
const emptyIndex = {
|
|
112
|
+
category: priority,
|
|
113
|
+
items: [],
|
|
114
|
+
updated: now,
|
|
115
|
+
};
|
|
116
|
+
writeFileSync(indexPath, JSON.stringify(emptyIndex, null, 2));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//=============================================================================
|
|
121
|
+
// READ OPERATIONS
|
|
122
|
+
//=============================================================================
|
|
123
|
+
/**
|
|
124
|
+
* Load single category index file
|
|
125
|
+
*
|
|
126
|
+
* @param filePath Absolute path to index file
|
|
127
|
+
* @returns Category index or empty if file missing
|
|
128
|
+
*/
|
|
129
|
+
function loadCategoryIndex(filePath) {
|
|
130
|
+
if (!existsSync(filePath)) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
135
|
+
const data = JSON.parse(content);
|
|
136
|
+
return validateCategoryIndex(data);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
throw new Error(`Failed to load index from ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Load index by item type
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const taskIds = await loadIndexByType(devstepsDir, 'task');
|
|
148
|
+
* // Returns: ['TASK-160', 'TASK-161', 'TASK-162']
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export function loadIndexByType(devstepsDir, type) {
|
|
152
|
+
const paths = getIndexPaths(devstepsDir);
|
|
153
|
+
const filename = INDEX_FILENAMES.TYPE[type];
|
|
154
|
+
const filePath = join(paths.byType, filename);
|
|
155
|
+
const index = loadCategoryIndex(filePath);
|
|
156
|
+
return index?.items ?? [];
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Load index by item status
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* const draftIds = await loadIndexByStatus(devstepsDir, 'draft');
|
|
164
|
+
* // Returns: ['STORY-069', 'TASK-198', ...]
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
export function loadIndexByStatus(devstepsDir, status) {
|
|
168
|
+
const paths = getIndexPaths(devstepsDir);
|
|
169
|
+
const filename = INDEX_FILENAMES.STATUS[status];
|
|
170
|
+
const filePath = join(paths.byStatus, filename);
|
|
171
|
+
const index = loadCategoryIndex(filePath);
|
|
172
|
+
return index?.items ?? [];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Load index by priority (Eisenhower quadrant)
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const urgentIds = await loadIndexByPriority(devstepsDir, 'urgent-important');
|
|
180
|
+
* // Returns Q1 items
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
export function loadIndexByPriority(devstepsDir, priority) {
|
|
184
|
+
const paths = getIndexPaths(devstepsDir);
|
|
185
|
+
const filename = INDEX_FILENAMES.PRIORITY[priority];
|
|
186
|
+
const filePath = join(paths.byPriority, filename);
|
|
187
|
+
const index = loadCategoryIndex(filePath);
|
|
188
|
+
return index?.items ?? [];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Load all indexes into memory
|
|
192
|
+
*
|
|
193
|
+
* Useful for operations that need complete index access.
|
|
194
|
+
* For most queries, prefer loading only the needed index.
|
|
195
|
+
*/
|
|
196
|
+
export function loadAllIndexes(devstepsDir) {
|
|
197
|
+
const paths = getIndexPaths(devstepsDir);
|
|
198
|
+
// Load counters
|
|
199
|
+
let counters = {};
|
|
200
|
+
if (existsSync(paths.counters)) {
|
|
201
|
+
const content = readFileSync(paths.counters, 'utf-8');
|
|
202
|
+
counters = validateCounters(JSON.parse(content));
|
|
203
|
+
}
|
|
204
|
+
// Load type indexes
|
|
205
|
+
const byType = new Map();
|
|
206
|
+
for (const type of Object.keys(INDEX_FILENAMES.TYPE)) {
|
|
207
|
+
byType.set(type, loadIndexByType(devstepsDir, type));
|
|
208
|
+
}
|
|
209
|
+
// Load status indexes
|
|
210
|
+
const byStatus = new Map();
|
|
211
|
+
for (const status of Object.keys(INDEX_FILENAMES.STATUS)) {
|
|
212
|
+
byStatus.set(status, loadIndexByStatus(devstepsDir, status));
|
|
213
|
+
}
|
|
214
|
+
// Load priority indexes
|
|
215
|
+
const byPriority = new Map();
|
|
216
|
+
for (const priority of Object.keys(INDEX_FILENAMES.PRIORITY)) {
|
|
217
|
+
byPriority.set(priority, loadIndexByPriority(devstepsDir, priority));
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
byType,
|
|
221
|
+
byStatus,
|
|
222
|
+
byPriority,
|
|
223
|
+
counters,
|
|
224
|
+
lastUpdated: getCurrentTimestamp(),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Load ID generation counters
|
|
229
|
+
*/
|
|
230
|
+
export function loadCounters(devstepsDir) {
|
|
231
|
+
const paths = getIndexPaths(devstepsDir);
|
|
232
|
+
if (!existsSync(paths.counters)) {
|
|
233
|
+
return {};
|
|
234
|
+
}
|
|
235
|
+
const content = readFileSync(paths.counters, 'utf-8');
|
|
236
|
+
return validateCounters(JSON.parse(content));
|
|
237
|
+
}
|
|
238
|
+
//=============================================================================
|
|
239
|
+
// WRITE OPERATIONS
|
|
240
|
+
//=============================================================================
|
|
241
|
+
/**
|
|
242
|
+
* Save category index to file (atomic write)
|
|
243
|
+
*
|
|
244
|
+
* @param filePath Absolute path to index file
|
|
245
|
+
* @param category Category name
|
|
246
|
+
* @param items Array of item IDs
|
|
247
|
+
*/
|
|
248
|
+
function saveCategoryIndex(filePath, category, items) {
|
|
249
|
+
const index = {
|
|
250
|
+
category,
|
|
251
|
+
items,
|
|
252
|
+
updated: getCurrentTimestamp(),
|
|
253
|
+
};
|
|
254
|
+
// Write directly (directory should already exist via update* functions)
|
|
255
|
+
writeFileSync(filePath, JSON.stringify(index, null, 2));
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Update type index
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* updateIndexByType(devstepsDir, 'task', ['TASK-160', 'TASK-161', 'TASK-162']);
|
|
263
|
+
* ```
|
|
264
|
+
*/
|
|
265
|
+
export function updateIndexByType(devstepsDir, type, items) {
|
|
266
|
+
const paths = getIndexPaths(devstepsDir);
|
|
267
|
+
const filename = INDEX_FILENAMES.TYPE[type];
|
|
268
|
+
const filePath = join(paths.byType, filename);
|
|
269
|
+
// Ensure directory exists
|
|
270
|
+
mkdirSync(paths.byType, { recursive: true });
|
|
271
|
+
saveCategoryIndex(filePath, type, items);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Update status index
|
|
275
|
+
*/
|
|
276
|
+
export function updateIndexByStatus(devstepsDir, status, items) {
|
|
277
|
+
const paths = getIndexPaths(devstepsDir);
|
|
278
|
+
const filename = INDEX_FILENAMES.STATUS[status];
|
|
279
|
+
const filePath = join(paths.byStatus, filename);
|
|
280
|
+
mkdirSync(paths.byStatus, { recursive: true });
|
|
281
|
+
saveCategoryIndex(filePath, status, items);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Update priority index
|
|
285
|
+
*/
|
|
286
|
+
export function updateIndexByPriority(devstepsDir, priority, items) {
|
|
287
|
+
const paths = getIndexPaths(devstepsDir);
|
|
288
|
+
const filename = INDEX_FILENAMES.PRIORITY[priority];
|
|
289
|
+
const filePath = join(paths.byPriority, filename);
|
|
290
|
+
mkdirSync(paths.byPriority, { recursive: true });
|
|
291
|
+
saveCategoryIndex(filePath, priority, items);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Update counters file
|
|
295
|
+
*/
|
|
296
|
+
export function updateCounters(devstepsDir, counters) {
|
|
297
|
+
const paths = getIndexPaths(devstepsDir);
|
|
298
|
+
mkdirSync(paths.root, { recursive: true });
|
|
299
|
+
const validated = validateCounters(counters);
|
|
300
|
+
writeFileSync(paths.counters, JSON.stringify(validated, null, 2));
|
|
301
|
+
}
|
|
302
|
+
//=============================================================================
|
|
303
|
+
// INDEX SYNCHRONIZATION
|
|
304
|
+
//=============================================================================
|
|
305
|
+
/**
|
|
306
|
+
* Add item to all relevant indexes
|
|
307
|
+
*
|
|
308
|
+
* Ensures consistency: item appears in exactly one index per dimension
|
|
309
|
+
*
|
|
310
|
+
* @param devstepsDir Path to .devsteps directory
|
|
311
|
+
* @param item Item metadata
|
|
312
|
+
*/
|
|
313
|
+
export function addItemToIndex(devstepsDir, item) {
|
|
314
|
+
// Add to type index
|
|
315
|
+
const typeItems = loadIndexByType(devstepsDir, item.type);
|
|
316
|
+
if (!typeItems.includes(item.id)) {
|
|
317
|
+
typeItems.push(item.id);
|
|
318
|
+
updateIndexByType(devstepsDir, item.type, typeItems);
|
|
319
|
+
}
|
|
320
|
+
// Add to status index
|
|
321
|
+
const statusItems = loadIndexByStatus(devstepsDir, item.status);
|
|
322
|
+
if (!statusItems.includes(item.id)) {
|
|
323
|
+
statusItems.push(item.id);
|
|
324
|
+
updateIndexByStatus(devstepsDir, item.status, statusItems);
|
|
325
|
+
}
|
|
326
|
+
// Add to priority index
|
|
327
|
+
const priorityItems = loadIndexByPriority(devstepsDir, item.eisenhower);
|
|
328
|
+
if (!priorityItems.includes(item.id)) {
|
|
329
|
+
priorityItems.push(item.id);
|
|
330
|
+
updateIndexByPriority(devstepsDir, item.eisenhower, priorityItems);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Remove item from all indexes
|
|
335
|
+
*
|
|
336
|
+
* @param devstepsDir Path to .devsteps directory
|
|
337
|
+
* @param itemId Item ID to remove
|
|
338
|
+
* @param type Item type (for efficient lookup)
|
|
339
|
+
* @param status Item status (for efficient lookup)
|
|
340
|
+
* @param priority Item priority (for efficient lookup)
|
|
341
|
+
*/
|
|
342
|
+
export function removeItemFromIndex(devstepsDir, itemId, type, status, priority) {
|
|
343
|
+
// Remove from type index
|
|
344
|
+
if (type) {
|
|
345
|
+
const typeItems = loadIndexByType(devstepsDir, type);
|
|
346
|
+
const filtered = typeItems.filter((id) => id !== itemId);
|
|
347
|
+
updateIndexByType(devstepsDir, type, filtered);
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
// Fallback: search all type indexes
|
|
351
|
+
for (const t of Object.keys(INDEX_FILENAMES.TYPE)) {
|
|
352
|
+
const items = loadIndexByType(devstepsDir, t);
|
|
353
|
+
if (items.includes(itemId)) {
|
|
354
|
+
updateIndexByType(devstepsDir, t, items.filter((id) => id !== itemId));
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
// Remove from status index
|
|
360
|
+
if (status) {
|
|
361
|
+
const statusItems = loadIndexByStatus(devstepsDir, status);
|
|
362
|
+
const filtered = statusItems.filter((id) => id !== itemId);
|
|
363
|
+
updateIndexByStatus(devstepsDir, status, filtered);
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
for (const s of Object.keys(INDEX_FILENAMES.STATUS)) {
|
|
367
|
+
const items = loadIndexByStatus(devstepsDir, s);
|
|
368
|
+
if (items.includes(itemId)) {
|
|
369
|
+
updateIndexByStatus(devstepsDir, s, items.filter((id) => id !== itemId));
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// Remove from priority index
|
|
375
|
+
if (priority) {
|
|
376
|
+
const priorityItems = loadIndexByPriority(devstepsDir, priority);
|
|
377
|
+
const filtered = priorityItems.filter((id) => id !== itemId);
|
|
378
|
+
updateIndexByPriority(devstepsDir, priority, filtered);
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
for (const p of Object.keys(INDEX_FILENAMES.PRIORITY)) {
|
|
382
|
+
const items = loadIndexByPriority(devstepsDir, p);
|
|
383
|
+
if (items.includes(itemId)) {
|
|
384
|
+
updateIndexByPriority(devstepsDir, p, items.filter((id) => id !== itemId));
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Update item in indexes (when status/priority changes)
|
|
392
|
+
*
|
|
393
|
+
* @param devstepsDir Path to .devsteps directory
|
|
394
|
+
* @param itemId Item ID
|
|
395
|
+
* @param oldStatus Previous status (to remove from old index)
|
|
396
|
+
* @param newStatus New status (to add to new index)
|
|
397
|
+
* @param oldPriority Previous priority
|
|
398
|
+
* @param newPriority New priority
|
|
399
|
+
*/
|
|
400
|
+
export function updateItemInIndex(devstepsDir, itemId, oldStatus, newStatus, oldPriority, newPriority) {
|
|
401
|
+
// Update status index
|
|
402
|
+
if (oldStatus && newStatus && oldStatus !== newStatus) {
|
|
403
|
+
// Remove from old status
|
|
404
|
+
const oldItems = loadIndexByStatus(devstepsDir, oldStatus);
|
|
405
|
+
updateIndexByStatus(devstepsDir, oldStatus, oldItems.filter((id) => id !== itemId));
|
|
406
|
+
// Add to new status
|
|
407
|
+
const newItems = loadIndexByStatus(devstepsDir, newStatus);
|
|
408
|
+
if (!newItems.includes(itemId)) {
|
|
409
|
+
newItems.push(itemId);
|
|
410
|
+
updateIndexByStatus(devstepsDir, newStatus, newItems);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
// Update priority index
|
|
414
|
+
if (oldPriority && newPriority && oldPriority !== newPriority) {
|
|
415
|
+
// Remove from old priority
|
|
416
|
+
const oldItems = loadIndexByPriority(devstepsDir, oldPriority);
|
|
417
|
+
updateIndexByPriority(devstepsDir, oldPriority, oldItems.filter((id) => id !== itemId));
|
|
418
|
+
// Add to new priority
|
|
419
|
+
const newItems = loadIndexByPriority(devstepsDir, newPriority);
|
|
420
|
+
if (!newItems.includes(itemId)) {
|
|
421
|
+
newItems.push(itemId);
|
|
422
|
+
updateIndexByPriority(devstepsDir, newPriority, newItems);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
//=============================================================================
|
|
427
|
+
// BACKWARD COMPATIBILITY
|
|
428
|
+
//=============================================================================
|
|
429
|
+
/**
|
|
430
|
+
* Load legacy index.json (for migration/fallback)
|
|
431
|
+
*
|
|
432
|
+
* @deprecated Use refs-style index operations instead
|
|
433
|
+
*/
|
|
434
|
+
export function loadLegacyIndex(devstepsDir) {
|
|
435
|
+
const paths = getIndexPaths(devstepsDir);
|
|
436
|
+
if (!existsSync(paths.legacy)) {
|
|
437
|
+
throw new Error('Legacy index.json not found');
|
|
438
|
+
}
|
|
439
|
+
const content = readFileSync(paths.legacy, 'utf-8');
|
|
440
|
+
return JSON.parse(content);
|
|
441
|
+
}
|
|
442
|
+
//# sourceMappingURL=index-refs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-refs.js","sourceRoot":"","sources":["../../src/core/index-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB;IAChD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAE7C,OAAO;QACN,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;QAClC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC;QACtC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC;QAC1C,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;QAC1C,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC;KACvC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACpD,MAAM,KAAK,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO,CACN,UAAU,CAAC,KAAK,CAAC,IAA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