@soulcraft/brainy 3.36.0 → 3.36.1
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 +5 -0
- package/dist/storage/adapters/gcsStorage.js +15 -5
- package/package.json +1 -1
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
|
+
### [3.36.1](https://github.com/soulcraftlabs/brainy/compare/v3.36.0...v3.36.1) (2025-10-10)
|
|
6
|
+
|
|
7
|
+
- fix: resolve critical GCS storage bugs preventing production use (3cd0b9a)
|
|
8
|
+
|
|
9
|
+
|
|
5
10
|
### [3.36.0](https://github.com/soulcraftlabs/brainy/compare/v3.35.0...v3.36.0) (2025-10-10)
|
|
6
11
|
|
|
7
12
|
#### 🚀 Always-Adaptive Caching with Enhanced Monitoring
|
|
@@ -16,6 +16,10 @@ import { getGlobalBackpressure } from '../../utils/adaptiveBackpressure.js';
|
|
|
16
16
|
import { getWriteBuffer } from '../../utils/writeBuffer.js';
|
|
17
17
|
import { getCoalescer } from '../../utils/requestCoalescer.js';
|
|
18
18
|
import { getShardIdFromUuid, getShardIdByIndex, TOTAL_SHARDS } from '../sharding.js';
|
|
19
|
+
// GCS API limits
|
|
20
|
+
// Maximum value for maxResults parameter in GCS API calls
|
|
21
|
+
// Values above this cause "Invalid unsigned integer" errors
|
|
22
|
+
const MAX_GCS_PAGE_SIZE = 5000;
|
|
19
23
|
/**
|
|
20
24
|
* Native Google Cloud Storage adapter for server environments
|
|
21
25
|
* Uses the @google-cloud/storage library with Application Default Credentials
|
|
@@ -385,7 +389,8 @@ export class GcsStorage extends BaseStorage {
|
|
|
385
389
|
id: data.id,
|
|
386
390
|
vector: data.vector,
|
|
387
391
|
connections,
|
|
388
|
-
level: data.level || 0
|
|
392
|
+
level: data.level || 0,
|
|
393
|
+
metadata: data.metadata // CRITICAL: Include metadata for entity reconstruction
|
|
389
394
|
};
|
|
390
395
|
// Update cache
|
|
391
396
|
this.nounCacheManager.set(id, node);
|
|
@@ -759,9 +764,12 @@ export class GcsStorage extends BaseStorage {
|
|
|
759
764
|
const shardId = getShardIdByIndex(shardIndex);
|
|
760
765
|
const shardPrefix = `${this.nounPrefix}${shardId}/`;
|
|
761
766
|
// List objects in this shard
|
|
767
|
+
// Cap maxResults to GCS API limit to prevent "Invalid unsigned integer" errors
|
|
768
|
+
const requestedPageSize = limit - nodes.length;
|
|
769
|
+
const cappedPageSize = Math.min(requestedPageSize, MAX_GCS_PAGE_SIZE);
|
|
762
770
|
const [files, , response] = await this.bucket.getFiles({
|
|
763
771
|
prefix: shardPrefix,
|
|
764
|
-
maxResults:
|
|
772
|
+
maxResults: cappedPageSize,
|
|
765
773
|
pageToken: shardIndex === startShardIndex ? gcsPageToken : undefined
|
|
766
774
|
});
|
|
767
775
|
// Extract node IDs from file names
|
|
@@ -880,9 +888,11 @@ export class GcsStorage extends BaseStorage {
|
|
|
880
888
|
const limit = options.limit || 100;
|
|
881
889
|
try {
|
|
882
890
|
// List verbs (simplified - not sharded yet in original implementation)
|
|
891
|
+
// Cap maxResults to GCS API limit to prevent "Invalid unsigned integer" errors
|
|
892
|
+
const cappedLimit = Math.min(limit, MAX_GCS_PAGE_SIZE);
|
|
883
893
|
const [files, , response] = await this.bucket.getFiles({
|
|
884
894
|
prefix: this.verbPrefix,
|
|
885
|
-
maxResults:
|
|
895
|
+
maxResults: cappedLimit,
|
|
886
896
|
pageToken: options.cursor
|
|
887
897
|
});
|
|
888
898
|
// If no files, return empty result
|
|
@@ -1039,7 +1049,7 @@ export class GcsStorage extends BaseStorage {
|
|
|
1039
1049
|
// Get bucket metadata
|
|
1040
1050
|
const [metadata] = await this.bucket.getMetadata();
|
|
1041
1051
|
return {
|
|
1042
|
-
type: 'gcs
|
|
1052
|
+
type: 'gcs',
|
|
1043
1053
|
used: 0, // GCS doesn't provide usage info easily
|
|
1044
1054
|
quota: null, // No quota in GCS
|
|
1045
1055
|
details: {
|
|
@@ -1053,7 +1063,7 @@ export class GcsStorage extends BaseStorage {
|
|
|
1053
1063
|
catch (error) {
|
|
1054
1064
|
this.logger.error('Failed to get storage status:', error);
|
|
1055
1065
|
return {
|
|
1056
|
-
type: 'gcs
|
|
1066
|
+
type: 'gcs',
|
|
1057
1067
|
used: 0,
|
|
1058
1068
|
quota: null
|
|
1059
1069
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "3.36.
|
|
3
|
+
"version": "3.36.1",
|
|
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",
|