fix: invert shoring ratio logic — higher offshore = better
The shoring indicator logic was backwards. In the business context, higher offshore = more cost-efficient = GOOD. Inverted logic: - Green: offshore >= threshold (target met, e.g. >= 55%) - Yellow: offshore close to threshold (threshold-10 to threshold) - Red: offshore below threshold (too little offshore, too expensive) Updated: - ShoringIndicator: getSeverity() inverted, badge text updated - ProjectModal: "Max Offshore" renamed to "Min Offshore" with new tooltip - AI Tool: status text reflects "target met" vs "below target" - Tool description: "higher offshore is better, threshold is minimum" Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -1389,7 +1389,7 @@ export const TOOL_DEFINITIONS: ToolDef[] = [
|
||||
type: "function",
|
||||
function: {
|
||||
name: "get_shoring_ratio",
|
||||
description: "Get the onshore/offshore staffing ratio for a project. Shows the percentage of work hours allocated to each country, whether the project exceeds its nearshore threshold, and a full country breakdown.",
|
||||
description: "Get the onshore/offshore staffing ratio for a project. Higher offshore is better (cost-efficient). The threshold is the MINIMUM offshore target. Shows country breakdown and whether the target is met.",
|
||||
parameters: {
|
||||
type: "object",
|
||||
properties: {
|
||||
@@ -5576,9 +5576,13 @@ const executors = {
|
||||
.map(([code, info]) => `${code} ${info.pct}% (${info.resourceCount} people)`)
|
||||
.join(", ");
|
||||
|
||||
const warning = result.isAboveThreshold ? ` -- Above ${threshold}% offshore threshold!` : "";
|
||||
const status = result.offshoreRatio >= threshold
|
||||
? `Target met (>=${threshold}% offshore)`
|
||||
: result.offshoreRatio >= threshold - 10
|
||||
? `Close to target (${threshold}% offshore needed)`
|
||||
: `Below target — only ${result.offshoreRatio}% offshore, need ${threshold}%`;
|
||||
|
||||
return `Project "${project.name}" (${project.shortCode}): ${result.onshoreRatio}% onshore (${onshoreCode}), ${result.offshoreRatio}% offshore. Breakdown: ${countryParts}.${warning}${result.unknownCount > 0 ? ` (${result.unknownCount} resource(s) without country)` : ""}`;
|
||||
return `Project "${project.name}" (${project.shortCode}): ${result.onshoreRatio}% onshore (${onshoreCode}), ${result.offshoreRatio}% offshore. ${status}. Breakdown: ${countryParts}.${result.unknownCount > 0 ? ` (${result.unknownCount} resource(s) without country)` : ""}`;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user