@soulcraft/brainy 4.8.4 → 4.8.6

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 CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [4.8.6](https://github.com/soulcraftlabs/brainy/compare/v4.8.5...v4.8.6) (2025-10-28)
6
+
7
+ - fix: per-sheet column detection in Excel importer (401443a)
8
+
9
+
5
10
  ### [4.7.4](https://github.com/soulcraftlabs/brainy/compare/v4.7.3...v4.7.4) (2025-10-27)
6
11
 
7
12
  **CRITICAL SYSTEMIC VFS BUG FIX - Workshop Team Unblocked!**
@@ -102,8 +102,24 @@ export class SmartExcelImporter {
102
102
  if (rows.length === 0) {
103
103
  return this.emptyResult(startTime);
104
104
  }
105
- // Detect column names
106
- const columns = this.detectColumns(rows[0], opts);
105
+ // CRITICAL FIX (v4.8.6): Detect columns per-sheet, not globally
106
+ // Different sheets may have different column structures (Term vs Name, etc.)
107
+ // Group rows by sheet and detect columns for each sheet separately
108
+ const rowsBySheet = new Map();
109
+ for (const row of rows) {
110
+ const sheet = row._sheet || 'default';
111
+ if (!rowsBySheet.has(sheet)) {
112
+ rowsBySheet.set(sheet, []);
113
+ }
114
+ rowsBySheet.get(sheet).push(row);
115
+ }
116
+ // Detect columns for each sheet
117
+ const columnsBySheet = new Map();
118
+ for (const [sheet, sheetRows] of rowsBySheet) {
119
+ if (sheetRows.length > 0) {
120
+ columnsBySheet.set(sheet, this.detectColumns(sheetRows[0], opts));
121
+ }
122
+ }
107
123
  // Process each row with BATCHED PARALLEL PROCESSING (v3.38.0)
108
124
  const extractedRows = [];
109
125
  const entityMap = new Map();
@@ -121,6 +137,9 @@ export class SmartExcelImporter {
121
137
  // Process chunk in parallel for massive speedup
122
138
  const chunkResults = await Promise.all(chunk.map(async (row, chunkIndex) => {
123
139
  const i = chunkStart + chunkIndex;
140
+ // CRITICAL FIX (v4.8.6): Use sheet-specific column mapping
141
+ const sheet = row._sheet || 'default';
142
+ const columns = columnsBySheet.get(sheet) || this.detectColumns(row, opts);
124
143
  // Extract data from row
125
144
  const term = this.getColumnValue(row, columns.term) || `Entity_${i}`;
126
145
  const definition = this.getColumnValue(row, columns.definition) || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "4.8.4",
3
+ "version": "4.8.6",
4
4
  "description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. 31 nouns × 40 verbs for infinite expressiveness.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",