Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/harness/application/actions/workflowActionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../workflow';

import { HarnessPolicyBlockedError } from '../policies/policyService';
import { resolveRuntimeLayout } from '../../../shared/fs/pathHelpers';
import { resolveRuntimeLayout, toPosixContextPath } from '../../../shared/fs/pathHelpers';
import type { HarnessWorkflowGuideInput } from '../workflow/workflowGuideTypes';

export interface HarnessWorkflowInitInput {
Expand Down Expand Up @@ -62,7 +62,7 @@ export class HarnessWorkflowActionService {
archivePrevious: params.archive_previous,
});

const workflowStatePath = resolveRuntimeLayout(contextPath).prevcFile;
const workflowStatePath = toPosixContextPath(resolveRuntimeLayout(contextPath).prevcFile);
const settings = await service.getSettings();
const scale = getScaleName(status.project.scale as ProjectScale);
const isAutonomous = settings.autonomous_mode;
Expand Down Expand Up @@ -131,13 +131,13 @@ export class HarnessWorkflowActionService {
error: 'No workflow found. Initialize a workflow first.',
suggestion: 'Use workflow-init({ name: "feature-name" }) to start.',
note: 'Workflows enable structured PREVC phases. Skip for trivial changes.',
workflowStatePath: resolveRuntimeLayout(contextPath).prevcFile,
workflowStatePath: toPosixContextPath(resolveRuntimeLayout(contextPath).prevcFile),
};
}

const summary = await service.getSummary();
const status = await service.getStatus();
const workflowStatePath = resolveRuntimeLayout(contextPath).prevcFile;
const workflowStatePath = toPosixContextPath(resolveRuntimeLayout(contextPath).prevcFile);
const orchestration = await service.getPhaseOrchestration(summary.currentPhase);
const harness = await service.getHarnessStatus();

Expand Down Expand Up @@ -170,7 +170,7 @@ export class HarnessWorkflowActionService {
success: false,
error: 'No workflow found. Initialize a workflow first.',
suggestion: 'Use workflow-init({ name: "feature-name" }) to start.',
workflowStatePath: resolveRuntimeLayout(contextPath).prevcFile,
workflowStatePath: toPosixContextPath(resolveRuntimeLayout(contextPath).prevcFile),
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/harness/application/context/contextTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ export const listFilesTool = createInternalTool<
async (input) => {
const { pattern, cwd, ignore } = input;
try {
const files = await glob(pattern, {
const files = (await glob(pattern, {
cwd: cwd || process.cwd(),
ignore: ignore || ['node_modules/**', '.git/**', 'dist/**'],
absolute: false
});
})).map((file) => file.split(path.sep).join('/'));
return {
success: true,
files,
Expand Down
4 changes: 2 additions & 2 deletions src/harness/application/workflow/plansService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '../../domain/workflow/plans';
import { PrevcStatusManager } from '../../domain/workflow/status/statusManager';
import { GitService } from '../../../utils/gitService';
import { resolveRuntimeLayoutFromRepo } from '../../../shared/fs/pathHelpers';
import { resolveRuntimeLayoutFromRepo, toPosixContextPath } from '../../../shared/fs/pathHelpers';
import type { PrevcPhase } from '../../domain/workflow/types';

export interface HarnessPlansServiceOptions {
Expand Down Expand Up @@ -87,7 +87,7 @@ export class HarnessPlansService {
canAdvanceToReview = gateResult.gates.plan_required.passed;
}

const workflowStatePath = resolveRuntimeLayoutFromRepo(this.repoPath).prevcFile;
const workflowStatePath = toPosixContextPath(resolveRuntimeLayoutFromRepo(this.repoPath).prevcFile);
const enhancementPrompt = workflowActive
? `PLAN LINKED TO ACTIVE WORKFLOW

Expand Down
7 changes: 7 additions & 0 deletions src/shared/fs/pathHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ export async function isFile(targetPath: string): Promise<boolean> {
}
}

/**
* Normalize an absolute path for cross-platform API responses (forward slashes).
*/
export function toPosixContextPath(absolutePath: string): string {
return absolutePath.split(path.sep).join('/');
}

/**
* Normalize path separators to forward slashes
*/
Expand Down
4 changes: 2 additions & 2 deletions src/utils/splashScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export function formatSplashDirectory(directory: string, maxLength = 48): string
const withTilde = resolved === homeDirectory
? '~'
: resolved.startsWith(`${homeDirectory}${path.sep}`)
? `~${path.sep}${path.relative(homeDirectory, resolved)}`
: resolved;
? `~/${path.relative(homeDirectory, resolved).split(path.sep).join('/')}`
: resolved.split(path.sep).join('/');

return truncateMiddle(withTilde, maxLength);
}
Expand Down