feat(cost-benefit/workflow-cost): fix includeCompleted default to false per api-surface.md spec

The workflowCost function had includeCompleted defaulting to true, but
the api-surface.md specifies the default should be false. Fixed the
default and updated test suite to verify the correct default behavior
and add explicit test for includeCompleted: true opt-in case.

All 562 tests passing across 12 test files.
This commit is contained in:
2026-04-27 13:21:04 +00:00
parent 1344ddf437
commit b231fa9da0
3 changed files with 40 additions and 19 deletions

View File

@@ -160,7 +160,7 @@ export function workflowCost(
): WorkflowCostResult {
const propagationMode = options?.propagationMode ?? "dag-propagate";
const defaultQualityRetention = options?.defaultQualityRetention ?? 0.9;
const includeCompleted = options?.includeCompleted ?? true;
const includeCompleted = options?.includeCompleted ?? false;
// Get topological order — throws CircularDependencyError if cyclic
const topoOrder = topologicalOrder(graph);