refactor: CI optimization, logging improvements, and codebase formatting (#456)
* fix(db): remove unique constraint on folder to support multi-channel agents * ci: implement automated skill drift detection and self-healing PRs * fix: align registration logic with Gavriel's feedback and fix build/test issues from Daniel Mi * style: conform to prettier standards for CI validation * test: fix branch naming inconsistency in CI (master vs main) * fix(ci): robust module resolution by removing file extensions in scripts * refactor(ci): simplify skill validation by removing redundant combination tests * style: conform skills-engine to prettier, unify logging in index.ts and cleanup unused imports * refactor: extract multi-channel DB changes to separate branch Move channel column, folder suffix logic, and related migrations to feat/multi-channel-db-v2 for independent review. This PR now contains only CI/CD optimizations, Prettier formatting, and logging improvements. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,9 @@ function nearestExistingPathOrSymlink(candidateAbsPath: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
function resolveRealPathWithSymlinkAwareAnchor(candidateAbsPath: string): string {
|
||||
function resolveRealPathWithSymlinkAwareAnchor(
|
||||
candidateAbsPath: string,
|
||||
): string {
|
||||
const anchorPath = nearestExistingPathOrSymlink(candidateAbsPath);
|
||||
const anchorStat = fs.lstatSync(anchorPath);
|
||||
let realAnchor: string;
|
||||
@@ -56,7 +58,9 @@ function safePath(projectRoot: string, relativePath: string): string | null {
|
||||
}
|
||||
|
||||
const realRoot = fs.realpathSync(root);
|
||||
const realParent = resolveRealPathWithSymlinkAwareAnchor(path.dirname(resolved));
|
||||
const realParent = resolveRealPathWithSymlinkAwareAnchor(
|
||||
path.dirname(resolved),
|
||||
);
|
||||
if (!isWithinRoot(realRoot, realParent)) {
|
||||
return null;
|
||||
}
|
||||
@@ -64,7 +68,10 @@ function safePath(projectRoot: string, relativePath: string): string | null {
|
||||
return resolved;
|
||||
}
|
||||
|
||||
export function executeFileOps(ops: FileOperation[], projectRoot: string): FileOpsResult {
|
||||
export function executeFileOps(
|
||||
ops: FileOperation[],
|
||||
projectRoot: string,
|
||||
): FileOpsResult {
|
||||
const result: FileOpsResult = {
|
||||
success: true,
|
||||
executed: [],
|
||||
@@ -122,7 +129,9 @@ export function executeFileOps(ops: FileOperation[], projectRoot: string): FileO
|
||||
return result;
|
||||
}
|
||||
if (!fs.existsSync(delPath)) {
|
||||
result.warnings.push(`delete: file does not exist (skipped): ${op.path}`);
|
||||
result.warnings.push(
|
||||
`delete: file does not exist (skipped): ${op.path}`,
|
||||
);
|
||||
result.executed.push(op);
|
||||
break;
|
||||
}
|
||||
@@ -169,7 +178,9 @@ export function executeFileOps(ops: FileOperation[], projectRoot: string): FileO
|
||||
}
|
||||
|
||||
default: {
|
||||
result.errors.push(`unknown operation type: ${(op as FileOperation).type}`);
|
||||
result.errors.push(
|
||||
`unknown operation type: ${(op as FileOperation).type}`,
|
||||
);
|
||||
result.success = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user