Skip to content

Commit 4ff4c32

Browse files
authored
fix: resolve registry intel cold start and ids dep (#724)
1 parent c25b66e commit 4ff4c32

6 files changed

Lines changed: 50 additions & 14 deletions

File tree

.aiox-core/core/code-intel/registry-syncer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class RegistrySyncer {
7474
async sync(options = {}) {
7575
const isFull = options.full === true;
7676

77+
// Bootstrap the lazy singleton before checking module-level provider availability.
78+
this._getClient();
79+
7780
// AC5: Fallback — check provider availability first
7881
if (!this._isProviderAvailable()) {
7982
this._logger('[registry-syncer] No code intelligence provider available, skipping enrichment');

.aiox-core/data/entity-registry.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
metadata:
22
version: 1.0.0
3-
lastUpdated: '2026-05-09T07:56:57.030Z'
3+
lastUpdated: '2026-05-10T16:26:31.587Z'
44
entityCount: 757
55
checksumAlgorithm: sha256
66
resolutionRate: 100
@@ -8319,17 +8319,17 @@ entities:
83198319
usedBy:
83208320
- sync-registry-intel
83218321
dependencies:
8322-
- code-intel
83238322
- registry-loader
83248323
externalDeps: []
8325-
plannedDeps: []
8324+
plannedDeps:
8325+
- code-intel-index
83268326
lifecycle: production
83278327
adaptability:
83288328
score: 0.4
83298329
constraints: []
83308330
extensionPoints: []
8331-
checksum: sha256:701102a519457938d5b9187b75a1f97d85cb5466cef23bce5edfb48b34c69ab8
8332-
lastVerified: '2026-03-11T00:48:55.875Z'
8331+
checksum: sha256:0fc20a7f90fc1ac2078878267db64517fd2ae75d8d2a81101d0cac77d1bf6458
8332+
lastVerified: '2026-05-10T16:26:31.572Z'
83338333
config-cache:
83348334
path: .aiox-core/core/config/config-cache.js
83358335
layer: L1
@@ -10673,7 +10673,6 @@ entities:
1067310673
- github-devops-pre-push-quality-gate
1067410674
- plan-create-context
1067510675
- plan-create-implementation
10676-
- registry-syncer
1067710676
- code-intel-source
1067810677
- metrics-source
1067910678
dependencies: []

.aiox-core/install-manifest.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# - File types for categorization
99
#
1010
version: 5.1.17
11-
generated_at: "2026-05-10T01:14:38.554Z"
11+
generated_at: "2026-05-10T16:27:34.757Z"
1212
generator: scripts/generate-install-manifest.js
1313
file_count: 1128
1414
files:
@@ -237,9 +237,9 @@ files:
237237
type: core
238238
size: 15619
239239
- path: core/code-intel/registry-syncer.js
240-
hash: sha256:701102a519457938d5b9187b75a1f97d85cb5466cef23bce5edfb48b34c69ab8
240+
hash: sha256:0fc20a7f90fc1ac2078878267db64517fd2ae75d8d2a81101d0cac77d1bf6458
241241
type: core
242-
size: 10891
242+
size: 11003
243243
- path: core/config/config-cache.js
244244
hash: sha256:9f3c3f90f574d5f49dd94592ab28109465d025b3a740d8639ab781c2560c12ab
245245
type: core
@@ -1297,9 +1297,9 @@ files:
12971297
type: data
12981298
size: 9590
12991299
- path: data/entity-registry.yaml
1300-
hash: sha256:4b701001f233800095b8830d8406209d1074bb2847fd5c279261b52452a2d71d
1300+
hash: sha256:84acf809f112cb726710a9878904db6b9d5c0eb487a2e578de25ede0c2177c5e
13011301
type: data
1302-
size: 529270
1302+
size: 529247
13031303
- path: data/learned-patterns.yaml
13041304
hash: sha256:24ac0b160615583a0ff783d3da8af80b7f94191575d6db2054ec8e10a3f945dc
13051305
type: data
@@ -3697,9 +3697,9 @@ files:
36973697
type: monitor
36983698
size: 818
36993699
- path: package.json
3700-
hash: sha256:9fdf0dcee2dcec6c0643634ee384ba181ad077dcff1267d8807434d4cb4809c7
3700+
hash: sha256:049326a853153ea930a49c1d083d5fa9a5eb5d05c3198f0322dbd831fe151b2e
37013701
type: other
3702-
size: 2495
3702+
size: 2529
37033703
- path: product/checklists/accessibility-wcag-checklist.md
37043704
hash: sha256:56126182b25e9b7bdde43f75315e33167eb49b1f9a9cb0e9a37bc068af40aeab
37053705
type: checklist

.aiox-core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"highlight.js": "^11.9.0",
4343
"inquirer": "^8.2.6",
4444
"js-yaml": "^4.1.0",
45+
"proper-lockfile": "^4.1.2",
4546
"semver": "^7.7.2",
4647
"tar": "^7.5.7",
4748
"validator": "^13.15.15"
@@ -104,4 +105,4 @@
104105
"./docs": "./docs/",
105106
"./elicitation": "./elicitation/"
106107
}
107-
}
108+
}

tests/code-intel/registry-syncer.test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const fs = require('fs');
44
const path = require('path');
55
const yaml = require('js-yaml');
6+
const codeIntel = require('../../.aiox-core/core/code-intel');
67
const { RegistrySyncer, inferRole, ROLE_MAP } = require('../../.aiox-core/core/code-intel/registry-syncer');
78

89
// Mock fs module for controlled testing
@@ -87,6 +88,8 @@ function createSyncer(options = {}) {
8788
describe('RegistrySyncer', () => {
8889
beforeEach(() => {
8990
jest.clearAllMocks();
91+
codeIntel.getClient.mockReset();
92+
codeIntel.isCodeIntelAvailable.mockReset().mockReturnValue(false);
9093
// Default fs mocks
9194
fs.existsSync.mockReturnValue(true);
9295
fs.writeFileSync.mockImplementation(() => {});
@@ -304,6 +307,30 @@ describe('RegistrySyncer', () => {
304307

305308
// T5: Fallback sem provider (AC5)
306309
describe('Fallback without provider (T5 — AC5)', () => {
310+
it('should bootstrap default client before checking module-level provider availability', async () => {
311+
const logger = jest.fn();
312+
const mockClient = createMockClient();
313+
314+
codeIntel.getClient.mockReturnValue(mockClient);
315+
codeIntel.isCodeIntelAvailable.mockImplementation(
316+
() => codeIntel.getClient.mock.calls.length > 0,
317+
);
318+
319+
const syncer = new RegistrySyncer({
320+
registryPath: '/mock/entity-registry.yaml',
321+
repoRoot: '/mock/repo',
322+
client: null,
323+
logger,
324+
});
325+
326+
const stats = await syncer.sync({ full: true });
327+
328+
expect(codeIntel.getClient).toHaveBeenCalled();
329+
expect(stats.aborted).toBeUndefined();
330+
expect(stats.processed).toBe(3);
331+
expect(fs.writeFileSync).toHaveBeenCalled();
332+
});
333+
307334
it('should skip enrichment and log message when no provider available', async () => {
308335
const logger = jest.fn();
309336
const syncer = new RegistrySyncer({

tests/unit/validate-aiox-core-deps.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ describe('validate-aiox-core-deps.js (INS-4.12)', () => {
5252
expect(pkg.dependencies).toHaveProperty('tar');
5353
});
5454

55+
test('.aiox-core/package.json includes proper-lockfile for IDS registry updater', () => {
56+
const pkgPath = path.join(PROJECT_ROOT, '.aiox-core', 'package.json');
57+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
58+
expect(pkg.dependencies).toHaveProperty('proper-lockfile');
59+
});
60+
5561
test('allowlisted packages (eslint, @babel/*) are not in deps', () => {
5662
const pkgPath = path.join(PROJECT_ROOT, '.aiox-core', 'package.json');
5763
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));

0 commit comments

Comments
 (0)