@nathapp/nax 0.55.0 → 0.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nax.js +21 -6
- package/package.json +1 -1
package/dist/nax.js
CHANGED
|
@@ -22404,7 +22404,7 @@ var package_default;
|
|
|
22404
22404
|
var init_package = __esm(() => {
|
|
22405
22405
|
package_default = {
|
|
22406
22406
|
name: "@nathapp/nax",
|
|
22407
|
-
version: "0.55.
|
|
22407
|
+
version: "0.55.1",
|
|
22408
22408
|
description: "AI Coding Agent Orchestrator \u2014 loops until done",
|
|
22409
22409
|
type: "module",
|
|
22410
22410
|
bin: {
|
|
@@ -22483,8 +22483,8 @@ var init_version = __esm(() => {
|
|
|
22483
22483
|
NAX_VERSION = package_default.version;
|
|
22484
22484
|
NAX_COMMIT = (() => {
|
|
22485
22485
|
try {
|
|
22486
|
-
if (/^[0-9a-f]{6,10}$/.test("
|
|
22487
|
-
return "
|
|
22486
|
+
if (/^[0-9a-f]{6,10}$/.test("a51fce0b"))
|
|
22487
|
+
return "a51fce0b";
|
|
22488
22488
|
} catch {}
|
|
22489
22489
|
try {
|
|
22490
22490
|
const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
|
|
@@ -25738,20 +25738,35 @@ Commit your fixes when done.${scopeConstraint}`;
|
|
|
25738
25738
|
async function runAgentRectification(ctx) {
|
|
25739
25739
|
const logger = getLogger();
|
|
25740
25740
|
const effectiveConfig = ctx.effectiveConfig ?? ctx.config;
|
|
25741
|
-
const
|
|
25741
|
+
const maxPerCycle = effectiveConfig.quality.autofix?.maxAttempts ?? 2;
|
|
25742
|
+
const maxTotal = effectiveConfig.quality.autofix?.maxTotalAttempts ?? 10;
|
|
25743
|
+
const consumed = ctx.autofixAttempt ?? 0;
|
|
25742
25744
|
const failedChecks = collectFailedChecks(ctx);
|
|
25743
25745
|
if (failedChecks.length === 0) {
|
|
25744
25746
|
logger.debug("autofix", "No failed checks found \u2014 skipping agent rectification", { storyId: ctx.story.id });
|
|
25745
25747
|
return false;
|
|
25746
25748
|
}
|
|
25749
|
+
if (consumed >= maxTotal) {
|
|
25750
|
+
logger.warn("autofix", "Global autofix budget exhausted \u2014 escalating", {
|
|
25751
|
+
storyId: ctx.story.id,
|
|
25752
|
+
totalAttempts: consumed,
|
|
25753
|
+
maxTotalAttempts: maxTotal
|
|
25754
|
+
});
|
|
25755
|
+
return false;
|
|
25756
|
+
}
|
|
25757
|
+
const remainingBudget = maxTotal - consumed;
|
|
25758
|
+
const maxAttempts = Math.min(maxPerCycle, remainingBudget);
|
|
25747
25759
|
logger.info("autofix", "Starting agent rectification for review failures", {
|
|
25748
25760
|
storyId: ctx.story.id,
|
|
25749
25761
|
failedChecks: failedChecks.map((c) => c.check),
|
|
25750
|
-
maxAttempts
|
|
25762
|
+
maxAttempts,
|
|
25763
|
+
totalUsed: consumed,
|
|
25764
|
+
maxTotalAttempts: maxTotal
|
|
25751
25765
|
});
|
|
25752
25766
|
const agentGetFn = ctx.agentGetFn ?? _autofixDeps.getAgent;
|
|
25753
25767
|
for (let attempt = 1;attempt <= maxAttempts; attempt++) {
|
|
25754
|
-
|
|
25768
|
+
ctx.autofixAttempt = consumed + attempt;
|
|
25769
|
+
logger.info("autofix", `Agent rectification attempt ${ctx.autofixAttempt}/${maxTotal}`, { storyId: ctx.story.id });
|
|
25755
25770
|
const agent = agentGetFn(ctx.config.autoMode.defaultAgent);
|
|
25756
25771
|
if (!agent) {
|
|
25757
25772
|
logger.error("autofix", "Agent not found \u2014 cannot run agent rectification", { storyId: ctx.story.id });
|