fix(FN-2145): enforce absolute .fusion roots in core storage
- Default AgentStore rootDir to resolve(".fusion") so agent data paths are absolute by default
- Default ReflectionStore rootDir to resolve(".fusion") for consistent absolute root resolution
- Validate Database kbDir is absolute and throw a descriptive error when a relative path is provided
This commit is contained in:
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
|
||||
import { EventEmitter } from "node:events";
|
||||
import { existsSync } from "node:fs";
|
||||
import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { join, resolve } from "node:path";
|
||||
import type {
|
||||
AgentPerformanceSummary,
|
||||
AgentReflection,
|
||||
@@ -63,7 +63,7 @@ export class ReflectionStore extends EventEmitter {
|
||||
|
||||
constructor(options: ReflectionStoreOptions = {}) {
|
||||
super();
|
||||
this.rootDir = options.rootDir ?? ".fusion";
|
||||
this.rootDir = options.rootDir ?? resolve(".fusion");
|
||||
this.agentsDir = join(this.rootDir, "agents");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user