feat(#2630): phase-estimation module, smart-zone config key, and cli verbs (#2661)

* feat(#2630): add phase-estimation module, smart-zone config key, and cli verbs

* fix(#2630): document smart_zone_tokens, refresh golden fixtures, fix null-proto property assertions

* fix(#2630): align smart_zone_tokens write/read validation and harden estimation tests

* chore(#2630): backfill changeset pr to 2661
This commit is contained in:
Tom Boucher
2026-07-26 01:42:47 -04:00
committed by GitHub
parent bf127b7d25
commit 46ba02acde
35 changed files with 1319 additions and 97 deletions

View File

@@ -89,6 +89,9 @@ const SCHEMA_DEFAULTS: Record<string, unknown> = {
'executor.stall_detect_interval_minutes': 5,
'executor.stall_threshold_minutes': 10,
'git.create_tag': true,
// Derived from the defaults manifest rather than restated, so the manifest
// stays the single source of truth for the smart-zone budget (#2630).
'workflow.smart_zone_tokens': CONFIG_DEFAULTS.smart_zone_tokens,
};
/**
@@ -773,6 +776,19 @@ function cmdConfigSet(cwd: string, keyPath: string | undefined, value: string |
}
}
// Smart-zone token budget (#2630, ADR-2629). Same shape as context_window:
// a positive integer token count. A POLICY default, not a benchmark constant.
// Number.isSafeInteger, NOT Number.isInteger: the read side
// (estimate-cli readSmartZoneBudget) accepts only safe integers, so an
// isInteger-only gate would let config-set 'succeed' on a value past 2^53
// that estimate-check then silently ignores in favour of the default.
// Accept and honour must agree.
if (kp === 'workflow.smart_zone_tokens') {
if (typeof parsedValue !== 'number' || !Number.isSafeInteger(parsedValue) || parsedValue < 1) {
error(`Invalid workflow.smart_zone_tokens '${val}'. Must be a positive integer (token count).`, ERROR_REASON.USAGE);
}
}
// Post-planning gap checker (#2493)
if (kp === 'workflow.post_planning_gaps') {
if (typeof parsedValue !== 'boolean') {