zelari-code 2.46.1 → 2.48.0
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/README.md +3 -3
- package/dist/cli/automations/browser/cookieDisk.js +56 -0
- package/dist/cli/automations/browser/cookieDisk.js.map +1 -0
- package/dist/cli/automations/browser/pageAdapter.js +130 -0
- package/dist/cli/automations/browser/pageAdapter.js.map +1 -0
- package/dist/cli/automations/browser/selectors.js +178 -0
- package/dist/cli/automations/browser/selectors.js.map +1 -0
- package/dist/cli/automations/browser/session.js +243 -0
- package/dist/cli/automations/browser/session.js.map +1 -0
- package/dist/cli/budget/budgetRuntime.js +9 -13
- package/dist/cli/budget/budgetRuntime.js.map +1 -1
- package/dist/cli/budget/essentialBashConfig.js +118 -0
- package/dist/cli/budget/essentialBashConfig.js.map +1 -0
- package/dist/cli/headless/runOneTurn.js +36 -6
- package/dist/cli/headless/runOneTurn.js.map +1 -1
- package/dist/cli/hooks/useChatTurn.js +30 -7
- package/dist/cli/hooks/useChatTurn.js.map +1 -1
- package/dist/cli/keyStore.js +2 -0
- package/dist/cli/keyStore.js.map +1 -1
- package/dist/cli/kraken/candidateRegistry.js +13 -0
- package/dist/cli/kraken/candidateRegistry.js.map +1 -1
- package/dist/cli/kraken/executor.js +200 -22
- package/dist/cli/kraken/executor.js.map +1 -1
- package/dist/cli/kraken/narrativeFloor.js +23 -0
- package/dist/cli/kraken/narrativeFloor.js.map +1 -0
- package/dist/cli/kraken/planner.js +27 -0
- package/dist/cli/kraken/planner.js.map +1 -1
- package/dist/cli/kraken/strictWaiver.js +22 -0
- package/dist/cli/kraken/strictWaiver.js.map +1 -0
- package/dist/cli/kraken/unresolvedGate.js +32 -0
- package/dist/cli/kraken/unresolvedGate.js.map +1 -0
- package/dist/cli/kraken/verificationBridge.js +67 -8
- package/dist/cli/kraken/verificationBridge.js.map +1 -1
- package/dist/cli/kraken/verifyHonestVerdict.js +30 -0
- package/dist/cli/kraken/verifyHonestVerdict.js.map +1 -0
- package/dist/cli/kraken/worktreeMergeRollback.js +277 -0
- package/dist/cli/kraken/worktreeMergeRollback.js.map +1 -0
- package/dist/cli/kraken/worktreeScheduling.js +11 -0
- package/dist/cli/kraken/worktreeScheduling.js.map +1 -1
- package/dist/cli/main.bundled.js +3278 -1483
- package/dist/cli/main.bundled.js.map +4 -4
- package/dist/cli/main.js +1 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/modelDiscovery.js +5 -1
- package/dist/cli/modelDiscovery.js.map +1 -1
- package/dist/cli/museOAuth.js +384 -0
- package/dist/cli/museOAuth.js.map +1 -0
- package/dist/cli/oauthDesktop.js +18 -1
- package/dist/cli/oauthDesktop.js.map +1 -1
- package/dist/cli/provider/openai-compatible.js +1 -0
- package/dist/cli/provider/openai-compatible.js.map +1 -1
- package/dist/cli/provider/resolveStream.js +2 -0
- package/dist/cli/provider/resolveStream.js.map +1 -1
- package/dist/cli/providerConfig.js +2 -0
- package/dist/cli/providerConfig.js.map +1 -1
- package/dist/cli/refreshRegistry.js +6 -0
- package/dist/cli/refreshRegistry.js.map +1 -1
- package/dist/cli/runHeadless.js +184 -100
- package/dist/cli/runHeadless.js.map +1 -1
- package/dist/cli/slashCommands.js +6 -6
- package/dist/cli/slashCommands.js.map +1 -1
- package/dist/cli/slashHandlers/krakenGraph.js +25 -7
- package/dist/cli/slashHandlers/krakenGraph.js.map +1 -1
- package/dist/cli/slashHandlers/provider.js +14 -4
- package/dist/cli/slashHandlers/provider.js.map +1 -1
- package/dist/cli/thinking.js +1 -0
- package/dist/cli/thinking.js.map +1 -1
- package/dist/cli/thinkingCapability.js +2 -0
- package/dist/cli/thinkingCapability.js.map +1 -1
- package/dist/cli/toolRegistry.js +22 -3
- package/dist/cli/toolRegistry.js.map +1 -1
- package/dist/cli/tools/bashWriteWatch.js +195 -0
- package/dist/cli/tools/bashWriteWatch.js.map +1 -0
- package/dist/cli/tools/krakenModel.js +50 -0
- package/dist/cli/tools/krakenModel.js.map +1 -1
- package/dist/cli/tools/krakenRadio.js +50 -5
- package/dist/cli/tools/krakenRadio.js.map +1 -1
- package/dist/cli/tools/krakenWorktree.js +35 -6
- package/dist/cli/tools/krakenWorktree.js.map +1 -1
- package/dist/cli/tools/taskTool.js +328 -34
- package/dist/cli/tools/taskTool.js.map +1 -1
- package/dist/cli/tools/verifyDebtSpine.js +117 -0
- package/dist/cli/tools/verifyDebtSpine.js.map +1 -0
- package/package.json +2 -2
|
@@ -91,6 +91,19 @@ export function getLastVerifyToolTrace() {
|
|
|
91
91
|
const trace = g.__zelariVerifyToolTrace;
|
|
92
92
|
return trace ? [...trace] : null;
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* K1.3: publish the raw tool executions of the latest verify tentacle on
|
|
96
|
+
* the per-turn channel independently of `setKrakenCheckResults` — so the
|
|
97
|
+
* auto-verify PASS-floor (≥ 1 captured tool execution) is observable even
|
|
98
|
+
* when no `selected` verdict ran this turn (no required-checks path).
|
|
99
|
+
*
|
|
100
|
+
* The existing channel `__zelariVerifyToolTrace` is reused; no new global.
|
|
101
|
+
* The argument may be empty (clears the slot to null) or any bounded ring.
|
|
102
|
+
*/
|
|
103
|
+
export function setLastVerifyToolTrace(trace) {
|
|
104
|
+
const g = globalThis;
|
|
105
|
+
g.__zelariVerifyToolTrace = trace.length > 0 ? [...trace] : null;
|
|
106
|
+
}
|
|
94
107
|
/**
|
|
95
108
|
* Passed-check counter (Fase 7): how many required checks carry an explicit
|
|
96
109
|
* `pass`. `unknown` NEVER counts — a degraded observation is not proof
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidateRegistry.js","sourceRoot":"","sources":["../../../src/cli/kraken/candidateRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA6CH,wEAAwE;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,uEAAuE;AACvE,MAAM,UAAU,wBAAwB;IACtC,OAAO,O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;KACF,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,iBAAiB,CAAC,KAA4B;IAC5D,MAAM,SAAS,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,EAAoB,CAAC;IAC3F,KAAK,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxB,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,yEAAyE;IACzE,+DAA+D;IAC/D,2EAA2E;IAC3E,+EAA+E;IAC/E,8EAA8E;IAC9E,2EAA2E;IAC3E,aAAa;IACb,8EAA8E;IAC9E,oBAAoB;IACpB,GAAG;IACH,6DAA6D;IAC7D,iBAAiB;IACjB,8FAA8F;IAC9F,MAAM;IACN,4CAA4C;IAC5C,GAAG;IACH,qBAAqB;CACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,uDAAuD;AACvD,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,GAAG,GAAG,oBAAoB;IAC7E,OAAO,sBAAsB,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACtG,CAAC"}
|
|
@@ -55,7 +55,9 @@ import { isAstSupported, parseFileSymbolsDiag } from '../ast/engine.js';
|
|
|
55
55
|
import { calculateCost } from '../modelPricing.js';
|
|
56
56
|
import { aggregate, REPUTATION_MIN_SAMPLE, reputationRecordFromNodeRun, } from './modelReputation.js';
|
|
57
57
|
// t30 (§17): spawn-ROI gate — deterministic score, threshold parsing and the
|
|
58
|
-
// duplication-risk heuristic; the veto itself lives in this class
|
|
58
|
+
// duplication-risk heuristic; the veto itself lives in this class and is
|
|
59
|
+
// fail-CLOSED on an internal error (K3.2: defer + `roi_gate_error`, never
|
|
60
|
+
// spawn).
|
|
59
61
|
import { computeSpawnScore, duplicationRiskFor, parseRoiThreshold, shouldSpawn, } from './spawnRoi.js';
|
|
60
62
|
import { appendRecord, DEFAULT_MAX_RECORDS, loadRecords, pruneStore, resolveReputationStorePath, } from './reputationStore.js';
|
|
61
63
|
import { setReputationSource } from './verifierRouting.js';
|
|
@@ -406,6 +408,16 @@ export class KrakenGraphExecutor {
|
|
|
406
408
|
/** Set once the run has been cancelled: stops admission, retries and fixes. */
|
|
407
409
|
aborted = false;
|
|
408
410
|
fixCounter = 0;
|
|
411
|
+
/**
|
|
412
|
+
* F12 (K2.4): set once any tentacle in this run reports a worktree-creation
|
|
413
|
+
* failure (it fell back to the SHARED parent tree). Latched for the rest of
|
|
414
|
+
* the run — deliberately NOT cleared: the P2.C rescue path admits
|
|
415
|
+
* overlapping writers in parallel ONLY because they are worktree-isolated,
|
|
416
|
+
* so once isolation is known-broken those rescues stop and overlapping
|
|
417
|
+
* writers serialize (P2.A deferral). There is no safe mid-run boundary at
|
|
418
|
+
* which to assume isolation recovered.
|
|
419
|
+
*/
|
|
420
|
+
worktreeFallbackSeen = false;
|
|
409
421
|
constructor(opts) {
|
|
410
422
|
this.deps = opts.taskToolDeps;
|
|
411
423
|
this.parentCwd = opts.parentCwd;
|
|
@@ -535,6 +547,8 @@ export class KrakenGraphExecutor {
|
|
|
535
547
|
// graph to always shrink monotonically (fix-node spawns grow it).
|
|
536
548
|
const maxIterations = Math.max(64, graph.nodes.size * 8);
|
|
537
549
|
let iterations = 0;
|
|
550
|
+
/** Why the loop broke early — the drain reports it on what it abandons. */
|
|
551
|
+
let stopReason = 'abort';
|
|
538
552
|
/** Node id → its running tentacle. One entry per in-flight node. */
|
|
539
553
|
const inFlight = new Map();
|
|
540
554
|
startKrakenGraphLive(graph);
|
|
@@ -547,6 +561,10 @@ export class KrakenGraphExecutor {
|
|
|
547
561
|
detail: `exceeded ${maxIterations} scheduling iterations without settling`,
|
|
548
562
|
ok: false,
|
|
549
563
|
});
|
|
564
|
+
stopReason = 'max-iterations';
|
|
565
|
+
// K3.1 (F14): the work still in flight is exactly what we are breaking
|
|
566
|
+
// OUT of waiting for — tell it to stop before the drain waits on it.
|
|
567
|
+
this.cancelRun();
|
|
550
568
|
break;
|
|
551
569
|
}
|
|
552
570
|
if (this.aborted && inFlight.size === 0)
|
|
@@ -603,15 +621,13 @@ export class KrakenGraphExecutor {
|
|
|
603
621
|
// The loop can break with work still in flight (iteration cap, or a
|
|
604
622
|
// cancellation whose tentacles have not unwound yet). Let those settle
|
|
605
623
|
// rather than returning a summary while they are still writing, and
|
|
606
|
-
// record what they produced.
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
inFlight.clear();
|
|
614
|
-
}
|
|
624
|
+
// record what they produced — but under K3.1's BOUNDED drain, because the
|
|
625
|
+
// tentacle that made the loop break is precisely the one that may never
|
|
626
|
+
// settle on its own.
|
|
627
|
+
const abandonedNodeIds = await this.drainInFlight(graph, inFlight, {
|
|
628
|
+
reason: stopReason,
|
|
629
|
+
timeoutMs: this.cancelGraceMs ?? resolveCancelGraceMs(),
|
|
630
|
+
});
|
|
615
631
|
// A cancelled run leaves nodes that never started: `skipped` says exactly
|
|
616
632
|
// that, and lets the graph settle so a summary can be returned.
|
|
617
633
|
if (this.aborted) {
|
|
@@ -709,6 +725,7 @@ export class KrakenGraphExecutor {
|
|
|
709
725
|
counts: countByStatus(graph),
|
|
710
726
|
durationsMs: Object.fromEntries(this.durationsMs),
|
|
711
727
|
cancelled: this.aborted,
|
|
728
|
+
abandonedNodeIds,
|
|
712
729
|
unresolvedFindings: [...this.unresolved],
|
|
713
730
|
...(backtest ? { backtest } : {}),
|
|
714
731
|
};
|
|
@@ -730,6 +747,120 @@ export class KrakenGraphExecutor {
|
|
|
730
747
|
for (const controller of this.nodeControllers.values())
|
|
731
748
|
controller.abort();
|
|
732
749
|
}
|
|
750
|
+
/**
|
|
751
|
+
* K3.1 (F14): settle the work still in flight when the scheduling loop breaks
|
|
752
|
+
* early — the iteration cap, or a cancellation whose tentacles have not
|
|
753
|
+
* unwound yet.
|
|
754
|
+
*
|
|
755
|
+
* This used to be a bare `Promise.all(inFlight)`, i.e. an UNBOUNDED wait: a
|
|
756
|
+
* tentacle stuck on a provider call that never yields hung `execute()`
|
|
757
|
+
* forever, so the cap that exists to escape the stall never produced a
|
|
758
|
+
* summary at all — and nothing had even told the stuck tentacle to stop. The
|
|
759
|
+
* order here is the point: cancel FIRST (a tentacle cannot unwind if nobody
|
|
760
|
+
* asked it to), then let the run settle inside one shared deadline, the same
|
|
761
|
+
* `cancelGraceMs` {@link withNodeTimeout} grants a cancelled run. What
|
|
762
|
+
* settles in that window is recorded exactly as the loop would have recorded
|
|
763
|
+
* it; what is still running when the deadline fires is a leftover, marked
|
|
764
|
+
* terminal here so no summary is ever emitted with a node still `running`.
|
|
765
|
+
*
|
|
766
|
+
* @returns the ids abandoned at the deadline (empty for a clean drain).
|
|
767
|
+
*/
|
|
768
|
+
async drainInFlight(graph, inFlight, opts) {
|
|
769
|
+
if (inFlight.size === 0)
|
|
770
|
+
return [];
|
|
771
|
+
// Idempotent: reaches the AbortController of every node we are about to
|
|
772
|
+
// stop waiting for.
|
|
773
|
+
this.cancelRun();
|
|
774
|
+
// ONE timer for the whole drain (not one per node), so the total wait is
|
|
775
|
+
// bounded by `timeoutMs`. Unref'd like `graphTimer` — a cancellation grace
|
|
776
|
+
// must never be what keeps the process alive.
|
|
777
|
+
const DRAIN_TIMED_OUT = Symbol('drain-timeout');
|
|
778
|
+
/**
|
|
779
|
+
* True when this drained entry holds the deadline sentinel instead of a
|
|
780
|
+
* settled node. (A plain `v !== DRAIN_TIMED_OUT` does not narrow here: the
|
|
781
|
+
* raced value is typed `SettledNode | symbol`, and TS will not subtract a
|
|
782
|
+
* unique symbol from the `symbol` member.)
|
|
783
|
+
*/
|
|
784
|
+
const hitDeadline = (v) => v === DRAIN_TIMED_OUT;
|
|
785
|
+
let timer;
|
|
786
|
+
const deadline = new Promise((resolve) => {
|
|
787
|
+
timer = setTimeout(() => resolve(DRAIN_TIMED_OUT), opts.timeoutMs);
|
|
788
|
+
timer.unref?.();
|
|
789
|
+
});
|
|
790
|
+
const drained = await Promise.all([...inFlight].map(async ([id, promise]) => ({
|
|
791
|
+
id,
|
|
792
|
+
outcome: await Promise.race([promise, deadline]),
|
|
793
|
+
}))).finally(() => {
|
|
794
|
+
if (timer)
|
|
795
|
+
clearTimeout(timer);
|
|
796
|
+
});
|
|
797
|
+
inFlight.clear();
|
|
798
|
+
const abandoned = [];
|
|
799
|
+
for (const { id, outcome } of drained) {
|
|
800
|
+
const node = graph.nodes.get(id);
|
|
801
|
+
if (!hitDeadline(outcome)) {
|
|
802
|
+
// Unwound inside the grace: an ordinary outcome, applied through the
|
|
803
|
+
// usual path. `applyResult` refuses to retry or spawn repairs because
|
|
804
|
+
// the run is aborted by now — right for a run that is stopping.
|
|
805
|
+
if (node)
|
|
806
|
+
await this.applyResultWithReask(graph, node, outcome.res);
|
|
807
|
+
continue;
|
|
808
|
+
}
|
|
809
|
+
abandoned.push(id);
|
|
810
|
+
if (!node)
|
|
811
|
+
continue;
|
|
812
|
+
const error = `abandoned after drain (${opts.reason}): tentacle did not stop within ` +
|
|
813
|
+
`${opts.timeoutMs}ms of being cancelled`;
|
|
814
|
+
node.status = 'error';
|
|
815
|
+
node.error = error;
|
|
816
|
+
// Same terminal bookkeeping as any other node that ends in `error`: the
|
|
817
|
+
// radio tail, the workbench graph tab and the digest must all stop
|
|
818
|
+
// showing it as running.
|
|
819
|
+
this.radio('node_end', {
|
|
820
|
+
description: node.label,
|
|
821
|
+
agent: node.kind,
|
|
822
|
+
detail: `abandoned after drain (${opts.reason})`,
|
|
823
|
+
ok: false,
|
|
824
|
+
});
|
|
825
|
+
this.wb?.markEnd(node.id, {
|
|
826
|
+
status: 'error',
|
|
827
|
+
error,
|
|
828
|
+
durationMs: this.durationsMs.get(node.id),
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
if (abandoned.length > 0) {
|
|
832
|
+
this.radio('progress', {
|
|
833
|
+
description: 'in-flight drain',
|
|
834
|
+
detail: `drain timed out after ${opts.timeoutMs}ms (${opts.reason}) — ` +
|
|
835
|
+
`${abandoned.length} abandoned: ${abandoned.join(', ')}`,
|
|
836
|
+
ok: false,
|
|
837
|
+
});
|
|
838
|
+
this.wb?.logEvent(`drain: ${abandoned.length} node(s) did not stop within ${opts.timeoutMs}ms ` +
|
|
839
|
+
`(${opts.reason}) — abandoned: ${abandoned.join(', ')}`);
|
|
840
|
+
}
|
|
841
|
+
return abandoned;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* F12 (K2.4): a tentacle reported a worktree-creation failure and is now
|
|
845
|
+
* writing into the shared parent tree. Latch {@link worktreeFallbackSeen} so
|
|
846
|
+
* {@link admit} stops rescuing overlapping writers via worktree isolation
|
|
847
|
+
* (they would no longer be actually isolated), and record the degradation
|
|
848
|
+
* once on the radio + workbench.
|
|
849
|
+
*/
|
|
850
|
+
noteWorktreeFallback(info) {
|
|
851
|
+
if (this.worktreeFallbackSeen)
|
|
852
|
+
return;
|
|
853
|
+
this.worktreeFallbackSeen = true;
|
|
854
|
+
const where = info.nodeId !== undefined ? ` [${info.nodeId}]` : '';
|
|
855
|
+
this.radio('progress', {
|
|
856
|
+
description: 'worktree fallback',
|
|
857
|
+
detail: `worktree creation failed (mode=${info.mode})${where} — run degraded to ` +
|
|
858
|
+
`serial admission: overlapping writers now defer for the rest of the run` +
|
|
859
|
+
(info.reason ? ` — ${info.reason}` : ''),
|
|
860
|
+
ok: false,
|
|
861
|
+
});
|
|
862
|
+
this.wb?.logEvent(`worktree fallback${where} — worktree creation failed (mode=${info.mode}); degrading to serial admission (overlapping writers defer for the rest of the run)`);
|
|
863
|
+
}
|
|
733
864
|
/**
|
|
734
865
|
* Pick the ready nodes that may start right now: parallel-safe against every
|
|
735
866
|
* node already running AND against each other, within the concurrency cap.
|
|
@@ -798,6 +929,7 @@ export class KrakenGraphExecutor {
|
|
|
798
929
|
this.deps.allowWorktree !== false
|
|
799
930
|
? worktreeSchedulingDecision(node, racing, process.env, {
|
|
800
931
|
caseInsensitive: this.ownershipCaseFolding,
|
|
932
|
+
sharedTreeDegraded: this.worktreeFallbackSeen,
|
|
801
933
|
})
|
|
802
934
|
: undefined;
|
|
803
935
|
if (decision && decision.mode === 'parallel-worktree') {
|
|
@@ -847,6 +979,7 @@ export class KrakenGraphExecutor {
|
|
|
847
979
|
if (!verdict)
|
|
848
980
|
continue;
|
|
849
981
|
const isolatable = worktreeMode === 'auto' &&
|
|
982
|
+
!this.worktreeFallbackSeen &&
|
|
850
983
|
isWorktreeCapableKind(node.kind) &&
|
|
851
984
|
!this.reworks.has(node.id) && // a rework edits an EXISTING worktree
|
|
852
985
|
this.deps.allowWorktree !== false;
|
|
@@ -887,15 +1020,17 @@ export class KrakenGraphExecutor {
|
|
|
887
1020
|
// value. Runs AFTER ownership arbitration and both rescues, so it can only
|
|
888
1021
|
// shrink the final spawn list; a node scoring below the threshold goes
|
|
889
1022
|
// back the deferred path (stays READY, re-offered next round — never
|
|
890
|
-
// failed) with a `node_roi_vetoed` radio trail. Fail-
|
|
891
|
-
// inside the gate
|
|
1023
|
+
// failed) with a `node_roi_vetoed` radio trail. Fail-CLOSED (K3.2/I3): an error
|
|
1024
|
+
// inside the gate defers the batch with a `roi_gate_error` radio (see roiGate).
|
|
892
1025
|
return (await this.roiGate([...admitted, ...rescued, ...semAdmitted], running)).spawn;
|
|
893
1026
|
}
|
|
894
1027
|
/**
|
|
895
1028
|
* P2.F: resolve the ROI gate's reputation source once per run — the
|
|
896
|
-
* injected fixture when given, else the repo's t29 store.
|
|
1029
|
+
* injected fixture when given, else the repo's t29 store. A
|
|
897
1030
|
* missing/corrupt store already degrades to [] inside loadRecords, and an
|
|
898
|
-
* unexpected error is swallowed the same way ("no history").
|
|
1031
|
+
* unexpected error is swallowed the same way ("no history"). Either way the
|
|
1032
|
+
* gate sees an unknown node and scores the sane defaults — K3.2 vetoes gate
|
|
1033
|
+
* ERRORS only; missing data still spawns.
|
|
899
1034
|
*/
|
|
900
1035
|
async roiReputationRecords() {
|
|
901
1036
|
if (this.roiReputation !== null)
|
|
@@ -950,9 +1085,11 @@ export class KrakenGraphExecutor {
|
|
|
950
1085
|
* ZELARI_KRAKEN_ROI_THRESHOLD (raw env string parsed per admit — invalid ⇒
|
|
951
1086
|
* default) and returns the survivors. Vetoed nodes are NOT failed: they are
|
|
952
1087
|
* simply not returned, so they stay READY and are re-offered next round,
|
|
953
|
-
* each with a `node_roi_vetoed` radio trail. Fail-
|
|
954
|
-
* while scoring ONE node
|
|
955
|
-
* loop
|
|
1088
|
+
* each with a `node_roi_vetoed` radio trail. Fail-CLOSED (K3.2/I3) twice
|
|
1089
|
+
* over: an internal error while scoring ONE node defers that node, and an
|
|
1090
|
+
* error that escapes the loop defers the whole batch — the gate must never
|
|
1091
|
+
* break a run, but it never lets an unvetted batch through either: every
|
|
1092
|
+
* gate failure fires a loud `roi_gate_error` radio.
|
|
956
1093
|
*/
|
|
957
1094
|
async roiGate(spawnList, running) {
|
|
958
1095
|
const spawn = [];
|
|
@@ -986,16 +1123,50 @@ export class KrakenGraphExecutor {
|
|
|
986
1123
|
});
|
|
987
1124
|
this.wb?.logEvent(`roi-vetoed ${node.id} "${node.label}" — spawnScore ${pinned} < ${threshold} (${score.rationaleCode}); deferred, not failed`);
|
|
988
1125
|
}
|
|
989
|
-
catch {
|
|
990
|
-
|
|
1126
|
+
catch (err) {
|
|
1127
|
+
// K3.2 (F15/I3): fail-CLOSED. An internal gate error is a veto, not
|
|
1128
|
+
// a spawn: the node goes back the deferred path (stays READY,
|
|
1129
|
+
// re-offered next round, never failed) and the failure is loud.
|
|
1130
|
+
vetoed.push(node);
|
|
1131
|
+
this.roiGateErrorRadio([node], err, threshold);
|
|
991
1132
|
}
|
|
992
1133
|
}
|
|
993
1134
|
}
|
|
994
|
-
catch {
|
|
995
|
-
|
|
1135
|
+
catch (err) {
|
|
1136
|
+
// K3.2 (F15/I3): fail-CLOSED for the whole batch. An internal error
|
|
1137
|
+
// must never hand the original spawnList back as survivors, whatever
|
|
1138
|
+
// partial verdicts the loop reached before it threw.
|
|
1139
|
+
this.roiGateErrorRadio(spawnList, err);
|
|
1140
|
+
return { spawn: [], vetoed: [...spawnList] };
|
|
996
1141
|
}
|
|
997
1142
|
return { spawn, vetoed };
|
|
998
1143
|
}
|
|
1144
|
+
/**
|
|
1145
|
+
* K3.2 (F15/I3): the ROI gate refused to spawn because of an INTERNAL error
|
|
1146
|
+
* (throwing score seam, unreadable reputation, whole-batch escape). Loud by
|
|
1147
|
+
* design and never silent: one `roi_gate_error` radio event plus a workbench
|
|
1148
|
+
* line, so a gate that never clears stays visible instead of reading as an
|
|
1149
|
+
* ordinary deferral. `deferred` is the node (or whole batch) pushed back the
|
|
1150
|
+
* READY / deferred path — nothing here fails a node.
|
|
1151
|
+
*/
|
|
1152
|
+
roiGateErrorRadio(deferred, err, threshold = null) {
|
|
1153
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
1154
|
+
const only = deferred.length === 1 ? deferred[0] : undefined;
|
|
1155
|
+
this.radio('roi_gate_error', {
|
|
1156
|
+
description: only ? only.label : `roi gate (${deferred.length} node(s))`,
|
|
1157
|
+
...(only ? { agent: only.kind, nodeId: only.id } : {}),
|
|
1158
|
+
...(threshold !== null ? { threshold } : {}),
|
|
1159
|
+
detail: only
|
|
1160
|
+
? `roi gate error: ${reason} — ${only.id} stays READY (not failed), never spawned`
|
|
1161
|
+
: `roi gate error: ${reason} — deferred ${deferred.length} node(s) [${deferred
|
|
1162
|
+
.map((n) => n.id)
|
|
1163
|
+
.join(', ')}], nothing spawned`,
|
|
1164
|
+
ok: false,
|
|
1165
|
+
});
|
|
1166
|
+
this.wb?.logEvent(only
|
|
1167
|
+
? `roi-gate-error ${only.id} "${only.label}" — ${reason}; deferred, not failed`
|
|
1168
|
+
: `roi-gate-error — ${reason}; deferred ${deferred.length} node(s); nothing spawned`);
|
|
1169
|
+
}
|
|
999
1170
|
/**
|
|
1000
1171
|
* P2.B: may `node` (held by P2.A/P2.C arbitration) run alongside the racing
|
|
1001
1172
|
* writers because BOTH sides declare disjoint symbol ownership? Only a pair
|
|
@@ -1095,7 +1266,13 @@ export class KrakenGraphExecutor {
|
|
|
1095
1266
|
// `allowWorktree: false` is what actually stops a rework from opening
|
|
1096
1267
|
// its own worktree: creation is driven by the agent kind ('general')
|
|
1097
1268
|
// inside runTentacle, not by anything the executor passes per-call.
|
|
1098
|
-
deps:
|
|
1269
|
+
deps: {
|
|
1270
|
+
...this.deps,
|
|
1271
|
+
// F12 (K2.4): latch a worktree-creation failure so the rest of the
|
|
1272
|
+
// run's admission policy degrades (see noteWorktreeFallback).
|
|
1273
|
+
onWorktreeFallback: (info) => this.noteWorktreeFallback(info),
|
|
1274
|
+
...(isRework ? { allowWorktree: false } : {}),
|
|
1275
|
+
},
|
|
1099
1276
|
args: {
|
|
1100
1277
|
description: node.label,
|
|
1101
1278
|
prompt: upstream ? `${node.prompt}\n${upstream}` : node.prompt,
|
|
@@ -1294,6 +1471,7 @@ export class KrakenGraphExecutor {
|
|
|
1294
1471
|
try {
|
|
1295
1472
|
result = await this.mergeFn(handle, {
|
|
1296
1473
|
message: `kraken: merge ${graph.nodes.get(depId)?.label ?? depId}`.slice(0, 200),
|
|
1474
|
+
sessionId: this.sessionId,
|
|
1297
1475
|
});
|
|
1298
1476
|
}
|
|
1299
1477
|
catch (err) {
|