Skip to content

Commit 0efceeb

Browse files
committed
fix(ci): make Windows cross-platform tests path-safe
1 parent e773670 commit 0efceeb

5 files changed

Lines changed: 26 additions & 18 deletions

File tree

.aiox-core/core/pro/pro-updater.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function resolveInstalledPro(projectRoot) {
113113
}
114114

115115
function readProjectPackageJson(projectRoot) {
116-
const packageJsonPath = path.join(projectRoot, 'package.json');
116+
const packageJsonPath = path.join(path.resolve(projectRoot), 'package.json');
117117
if (!fs.existsSync(packageJsonPath)) {
118118
return null;
119119
}
@@ -126,12 +126,14 @@ function readProjectPackageJson(projectRoot) {
126126
}
127127

128128
function buildNodeModulesPackageJsonPath(projectRoot, packageName) {
129+
const resolvedProjectRoot = path.resolve(projectRoot);
130+
129131
if (packageName.startsWith('@')) {
130132
const [scope, name] = packageName.slice(1).split('/');
131-
return path.join(projectRoot, 'node_modules', scope, name, 'package.json');
133+
return path.join(resolvedProjectRoot, 'node_modules', scope, name, 'package.json');
132134
}
133135

134-
return path.join(projectRoot, 'node_modules', packageName, 'package.json');
136+
return path.join(resolvedProjectRoot, 'node_modules', packageName, 'package.json');
135137
}
136138

137139
function detectCorePackageName(projectRoot) {
@@ -187,7 +189,8 @@ function assertValidProjectRoot(projectRoot) {
187189
* @returns {string|null}
188190
*/
189191
function getCoreVersion(projectRoot) {
190-
const versionJsonPath = path.join(projectRoot, '.aiox-core', 'version.json');
192+
const resolvedProjectRoot = path.resolve(projectRoot);
193+
const versionJsonPath = path.join(resolvedProjectRoot, '.aiox-core', 'version.json');
191194
if (fs.existsSync(versionJsonPath)) {
192195
try {
193196
const versionInfo = JSON.parse(fs.readFileSync(versionJsonPath, 'utf8'));
@@ -200,7 +203,7 @@ function getCoreVersion(projectRoot) {
200203
}
201204

202205
for (const packageName of CORE_PACKAGES) {
203-
const packageJsonPath = buildNodeModulesPackageJsonPath(projectRoot, packageName);
206+
const packageJsonPath = buildNodeModulesPackageJsonPath(resolvedProjectRoot, packageName);
204207
if (fs.existsSync(packageJsonPath)) {
205208
try {
206209
const data = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
@@ -211,13 +214,13 @@ function getCoreVersion(projectRoot) {
211214
}
212215
}
213216

214-
const projectPackageJson = readProjectPackageJson(projectRoot);
217+
const projectPackageJson = readProjectPackageJson(resolvedProjectRoot);
215218
if (projectPackageJson) {
216219
if (CORE_PACKAGES.includes(projectPackageJson.name)) {
217220
return projectPackageJson.version || null;
218221
}
219222

220-
const declaredCorePackage = detectCorePackageName(projectRoot);
223+
const declaredCorePackage = detectCorePackageName(resolvedProjectRoot);
221224
if (declaredCorePackage) {
222225
for (const field of DEPENDENCY_FIELDS) {
223226
const declaredVersion = projectPackageJson[field]?.[declaredCorePackage];

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
metadata:
22
version: 1.0.0
3-
lastUpdated: '2026-05-08T19:57:34.743Z'
3+
lastUpdated: '2026-05-08T21:17:46.181Z'
44
entityCount: 755
55
checksumAlgorithm: sha256
66
resolutionRate: 100
@@ -12802,8 +12802,8 @@ entities:
1280212802
score: 0.4
1280312803
constraints: []
1280412804
extensionPoints: []
12805-
checksum: sha256:532bdded456b4d5c62ddcfb82a145c67e2c34a42153589cf7a4632d27b16fa7d
12806-
lastVerified: '2026-05-08T19:57:34.737Z'
12805+
checksum: sha256:30ea78b8ab088e695936ae662057697410856751f463eeb649e00b67dcc31531
12806+
lastVerified: '2026-05-08T21:17:46.174Z'
1280712807
externalDeps: []
1280812808
plannedDeps: []
1280912809
lifecycle: orphan

.aiox-core/install-manifest.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# - File types for categorization
99
#
1010
version: 5.1.15
11-
generated_at: "2026-05-08T19:58:26.832Z"
11+
generated_at: "2026-05-08T21:23:27.015Z"
1212
generator: scripts/generate-install-manifest.js
1313
file_count: 1121
1414
files:
@@ -1009,9 +1009,9 @@ files:
10091009
type: core
10101010
size: 7193
10111011
- path: core/pro/pro-updater.js
1012-
hash: sha256:532bdded456b4d5c62ddcfb82a145c67e2c34a42153589cf7a4632d27b16fa7d
1012+
hash: sha256:30ea78b8ab088e695936ae662057697410856751f463eeb649e00b67dcc31531
10131013
type: core
1014-
size: 17817
1014+
size: 17994
10151015
- path: core/quality-gates/base-layer.js
10161016
hash: sha256:9a9a3921da08176b0bd44f338a59abc1f5107f3b1ee56571e840bf4e8ed233f4
10171017
type: core
@@ -1277,7 +1277,7 @@ files:
12771277
type: data
12781278
size: 9590
12791279
- path: data/entity-registry.yaml
1280-
hash: sha256:978e53082f9799d21b396a23901bb97a524999ee2604d1d27454aba20bc68f32
1280+
hash: sha256:c115355ba33df1671460f3ba51baba5235db865f34a0f3e8b6ec3c8a31134be2
12811281
type: data
12821282
size: 528021
12831283
- path: data/learned-patterns.yaml

tests/cli/aiox-delegate.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const {
1212

1313
describe('aiox-delegate external executor CLI', () => {
1414
const fixedDate = new Date(Date.UTC(2026, 4, 8, 2, 30, 45));
15+
const workdir = path.resolve('/tmp/work');
1516

1617
test('parses codex delegation arguments', () => {
1718
const options = parseArgs([
@@ -42,10 +43,10 @@ describe('aiox-delegate external executor CLI', () => {
4243
);
4344

4445
expect(plan.slug).toBe('story-4.3');
45-
expect(plan.runDir).toBe('/tmp/work/.aiox/external-runs/20260508-023045-story-4.3');
46+
expect(plan.runDir).toBe(path.join(workdir, '.aiox', 'external-runs', '20260508-023045-story-4.3'));
4647
expect(plan.command).toBe('codex');
4748
expect(plan.args).toEqual(
48-
expect.arrayContaining(['-a', 'never', '-s', 'workspace-write', 'exec', '-C', '/tmp/work']),
49+
expect.arrayContaining(['-a', 'never', '-s', 'workspace-write', 'exec', '-C', workdir]),
4950
);
5051
expect(plan.args.at(-1)).toBe('-');
5152
expect(plan.outputPath).toBe(path.join(plan.runDir, 'output.md'));
@@ -68,7 +69,7 @@ describe('aiox-delegate external executor CLI', () => {
6869
);
6970

7071
expect(plan.args).toEqual(
71-
expect.arrayContaining(['-a', 'never', '-s', 'workspace-write', 'exec', '-C', '/tmp/work']),
72+
expect.arrayContaining(['-a', 'never', '-s', 'workspace-write', 'exec', '-C', workdir]),
7273
);
7374
});
7475

tests/core/orchestration/bob-orchestrator.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const {
1515
// Test fixtures
1616
const TEST_PROJECT_ROOT = path.join(__dirname, '../../fixtures/test-project-bob');
1717

18+
function portablePath(targetPath) {
19+
return String(targetPath).replace(/\\/g, '/');
20+
}
21+
1822
// Mock Epic 11 modules
1923
jest.mock('../../../.aiox-core/core/config/config-resolver', () => ({
2024
resolveConfig: jest.fn(),
@@ -1061,7 +1065,7 @@ describe('BobOrchestrator', () => {
10611065
const result = orchestrator._resolveStoryPath('99.99');
10621066

10631067
// Then
1064-
expect(result).toContain('docs/stories/active');
1068+
expect(portablePath(result)).toContain('docs/stories/active');
10651069
expect(result).toContain('99.99.story.md');
10661070
});
10671071
});

0 commit comments

Comments
 (0)