@cat-factory/orchestration 0.269.0 → 0.270.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/modules/debug/debug.logic.d.ts.map +1 -1
- package/dist/modules/debug/debug.logic.js +1 -0
- package/dist/modules/debug/debug.logic.js.map +1 -1
- package/dist/modules/execution/AgentDispatchController.d.ts.map +1 -1
- package/dist/modules/execution/AgentDispatchController.js +5 -3
- package/dist/modules/execution/AgentDispatchController.js.map +1 -1
- package/dist/modules/execution/CompanionController.d.ts.map +1 -1
- package/dist/modules/execution/CompanionController.js +37 -4
- package/dist/modules/execution/CompanionController.js.map +1 -1
- package/dist/modules/execution/IterationCapController.d.ts.map +1 -1
- package/dist/modules/execution/IterationCapController.js +4 -1
- package/dist/modules/execution/IterationCapController.js.map +1 -1
- package/dist/modules/execution/PollCompletionController.d.ts +16 -1
- package/dist/modules/execution/PollCompletionController.d.ts.map +1 -1
- package/dist/modules/execution/PollCompletionController.js +52 -12
- package/dist/modules/execution/PollCompletionController.js.map +1 -1
- package/dist/modules/execution/StepGraph.d.ts +7 -0
- package/dist/modules/execution/StepGraph.d.ts.map +1 -1
- package/dist/modules/execution/StepGraph.js +13 -0
- package/dist/modules/execution/StepGraph.js.map +1 -1
- package/dist/modules/execution/companionProgress.logic.d.ts +51 -0
- package/dist/modules/execution/companionProgress.logic.d.ts.map +1 -0
- package/dist/modules/execution/companionProgress.logic.js +91 -0
- package/dist/modules/execution/companionProgress.logic.js.map +1 -0
- package/dist/modules/execution/job.logic.d.ts +24 -0
- package/dist/modules/execution/job.logic.d.ts.map +1 -1
- package/dist/modules/execution/job.logic.js +42 -5
- package/dist/modules/execution/job.logic.js.map +1 -1
- package/dist/modules/kaizen/KaizenService.d.ts +3 -1
- package/dist/modules/kaizen/KaizenService.d.ts.map +1 -1
- package/dist/modules/kaizen/KaizenService.js +60 -11
- package/dist/modules/kaizen/KaizenService.js.map +1 -1
- package/dist/modules/observability/AgentContextObservabilityService.d.ts +16 -6
- package/dist/modules/observability/AgentContextObservabilityService.d.ts.map +1 -1
- package/dist/modules/observability/AgentContextObservabilityService.js +14 -10
- package/dist/modules/observability/AgentContextObservabilityService.js.map +1 -1
- package/dist/modules/observability/LlmObservabilityService.d.ts +6 -0
- package/dist/modules/observability/LlmObservabilityService.d.ts.map +1 -1
- package/dist/modules/observability/LlmObservabilityService.js +7 -1
- package/dist/modules/observability/LlmObservabilityService.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepGraph.js","sourceRoot":"","sources":["../../../src/modules/execution/StepGraph.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,SAAS;IAED,KAAK;IAOL,iBAAiB;IARpC,YACmB,KAAY;IAC7B;;;;;OAKG;IACc,iBAAqC;qBAPrC,KAAK;iCAOL,iBAAiB;IACjC,CAAC;IAEJ,4FAA4F;IAC5F,SAAS,CAAC,IAAkB;QAC1B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;QACtB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAA;YACjC,qFAAqF;YACrF,uFAAuF;YACvF,qFAAqF;YACrF,kFAAkF;YAClF,iFAAiF;YACjF,IAAI,CAAC,cAAc,KAAK,IAAI,CAAC,SAAS,CAAA;YACtC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QAC1C,CAAC;QACD,+EAA+E;QAC/E,sDAAsD;QACtD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;IACtB,CAAC;IAED;;;;;;;;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AC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,SAAS,CAAC;gBAAE,OAAO,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,CAAC,CAAC,CAAA;IACX,CAAC;IAED;;;;;;OAMG;IACH,qBAAqB,CACnB,QAA2B,EAC3B,cAAsB,EACtB,MAA2C;QAE3C,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACpD,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,2CAA2C,cAAc,EAAE,CAAC,CAAA;QAC9E,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,gCAAgC,aAAa,CAAC,SAAS,qCAAqC,CAC7F,CAAA;QACH,CAAC;QACD,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;QAC3E,qFAAqF;QACrF,qFAAqF;QACrF,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,qCAAqC,aAAa,CAAC,SAAS,uCAAuC,CACpG,CAAA;QACH,CAAC;QACD,aAAa,CAAC,SAAS,CAAC,QAAQ,IAAI,CAAC,CAAA;QACrC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,CAAC,CAAA;QAC1E,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS;YAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAA;IAChE,CAAC;CACF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { PipelineStep } from '@cat-factory/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* Whether this grading cycle proves the loop has stopped making progress, and the rounds still on
|
|
4
|
+
* the budget would only repeat it.
|
|
5
|
+
*
|
|
6
|
+
* EVERY half must hold, and that conjunction is the whole design:
|
|
7
|
+
*
|
|
8
|
+
* - **The producer's work is legible here at all.** Only a producer whose DELIVERABLE is its
|
|
9
|
+
* reply (`deliverableIsReply`) can be judged by comparing `output`. A `container-coding`
|
|
10
|
+
* producer pushes commits and legitimately ends with no final text — the `reviewer`/`coder`
|
|
11
|
+
* pair is exactly that, which is why the reviewer reads the real diff instead of the summary —
|
|
12
|
+
* so for those two rounds of empty output are what a working producer looks like, not a
|
|
13
|
+
* standstill. Nothing on the step records the branch tip, so there is no second signal to fall
|
|
14
|
+
* back on: the honest answer is that this rule cannot speak for that pair.
|
|
15
|
+
* - **The rework was this loop's own.** `requestedBy: 'reviewer'` covers the automatic rounds and
|
|
16
|
+
* the extra round a human grants (which the companion's verdict still drives). A human "request
|
|
17
|
+
* changes" cycle lands on the same `rework` field with `requestedBy: 'human'` and consumes NO
|
|
18
|
+
* attempts, so concluding a standstill from it would abandon an automatic budget that was never
|
|
19
|
+
* spent, over a round nobody here asked for.
|
|
20
|
+
* - **The producer did not change the work.** Its current `output` normalises to the same text as
|
|
21
|
+
* the `previousProposal` it was handed to revise. That is the only signal available here that
|
|
22
|
+
* is about the WORK rather than about an opinion of it.
|
|
23
|
+
* - **The rating did not move.** Compared against the previous cycle's verdict, within
|
|
24
|
+
* {@link RATING_EPSILON}. A rating that MOVED on unchanged text means the grader has changed
|
|
25
|
+
* its mind, and the next round can legitimately differ, so the loop is left alone.
|
|
26
|
+
*
|
|
27
|
+
* Requiring all of them is what keeps this from firing on the ordinary cases it would otherwise
|
|
28
|
+
* ruin: a first round always has no predecessor to compare against, and a producer that made a
|
|
29
|
+
* small edit for a rating that stayed flat is still working. The cost of a false NEGATIVE is one
|
|
30
|
+
* wasted round, already bounded by `maxAttempts`; the cost of a false positive is a run cut short
|
|
31
|
+
* with work left undone, so every branch errs the cheap way.
|
|
32
|
+
*
|
|
33
|
+
* Deliberately NOT keyed on the number of rounds a finding has stayed open. A companion that keeps
|
|
34
|
+
* raising the same point at a producer that keeps arguing back is a loop doing exactly what the
|
|
35
|
+
* feedback-accounting directives ask of it, and stopping that would punish the disagreement
|
|
36
|
+
* channel those exist to provide.
|
|
37
|
+
*/
|
|
38
|
+
export declare function companionLoopStalled(args: {
|
|
39
|
+
/** The producer step as it stands after this round's re-run. */
|
|
40
|
+
producer: PipelineStep | undefined;
|
|
41
|
+
/** The companion's verdict history INCLUDING this cycle's, newest last. */
|
|
42
|
+
verdicts: NonNullable<PipelineStep['companion']>['verdicts'];
|
|
43
|
+
/**
|
|
44
|
+
* Whether the producer KIND's deliverable is the reply text its `output` holds, from the kind's
|
|
45
|
+
* own declared surface (`deliverableIsReply`). Passed in rather than derived here so this stays
|
|
46
|
+
* a pure rule over one step's state, and so the caller's registry — which is where a
|
|
47
|
+
* deployment's own producer kinds live — is the thing that answers it.
|
|
48
|
+
*/
|
|
49
|
+
producerDeliverableIsReply: boolean;
|
|
50
|
+
}): boolean;
|
|
51
|
+
//# sourceMappingURL=companionProgress.logic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companionProgress.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/companionProgress.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAyCvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,gEAAgE;IAChE,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAA;IAClC,2EAA2E;IAC3E,QAAQ,EAAE,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IAC5D;;;;;OAKG;IACH,0BAA0B,EAAE,OAAO,CAAA;CACpC,GAAG,OAAO,CAaV"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Whether a companion rework loop is still getting anywhere.
|
|
2
|
+
//
|
|
3
|
+
// `attempts < maxAttempts` bounds how LONG a loop may run and says nothing about whether it is
|
|
4
|
+
// converging. A real run sat on an `architect-companion` rating of exactly 0.76 for four rounds
|
|
5
|
+
// while the companion's own round-4 text said the document was "materially identical to the one I
|
|
6
|
+
// rated 0.76 three times"; the two blocking items it opened in round 1 were still open when the
|
|
7
|
+
// budget ran out. Each of those rounds cost a full grading call, and none of them could have
|
|
8
|
+
// produced a different answer.
|
|
9
|
+
//
|
|
10
|
+
// The cause of THAT run was a dispatch-id collision that stopped the producer re-running at all
|
|
11
|
+
// (fixed separately, in `dispatchEpochFor`). This is the other half: a producer that genuinely
|
|
12
|
+
// re-runs and returns the same work is the same dead loop, and nothing was watching for it.
|
|
13
|
+
/**
|
|
14
|
+
* How close two ratings must be to count as "did not move".
|
|
15
|
+
*
|
|
16
|
+
* Exact equality is too strict for a model emitting a float, and anything much wider starts
|
|
17
|
+
* swallowing real movement: at 0.01 a loop that climbs a hundredth per round still reads as
|
|
18
|
+
* progress, while the 0.76 → 0.76 → 0.76 case reads as the standstill it is.
|
|
19
|
+
*/
|
|
20
|
+
const RATING_EPSILON = 0.01;
|
|
21
|
+
/**
|
|
22
|
+
* Normalise a proposal for comparison: trailing whitespace per line and blank runs collapsed.
|
|
23
|
+
*
|
|
24
|
+
* A pure byte compare would be defeated by a model re-emitting its own text with one reflowed
|
|
25
|
+
* paragraph, and anything cleverer (a similarity ratio, a token diff) would be a threshold nobody
|
|
26
|
+
* can justify and a false stop nobody can debug. This catches the case that actually happens: the
|
|
27
|
+
* producer returned what it was handed.
|
|
28
|
+
*/
|
|
29
|
+
function normalizeProposal(text) {
|
|
30
|
+
return text
|
|
31
|
+
.split('\n')
|
|
32
|
+
.map((line) => line.trimEnd())
|
|
33
|
+
.join('\n')
|
|
34
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
35
|
+
.trim();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Whether this grading cycle proves the loop has stopped making progress, and the rounds still on
|
|
39
|
+
* the budget would only repeat it.
|
|
40
|
+
*
|
|
41
|
+
* EVERY half must hold, and that conjunction is the whole design:
|
|
42
|
+
*
|
|
43
|
+
* - **The producer's work is legible here at all.** Only a producer whose DELIVERABLE is its
|
|
44
|
+
* reply (`deliverableIsReply`) can be judged by comparing `output`. A `container-coding`
|
|
45
|
+
* producer pushes commits and legitimately ends with no final text — the `reviewer`/`coder`
|
|
46
|
+
* pair is exactly that, which is why the reviewer reads the real diff instead of the summary —
|
|
47
|
+
* so for those two rounds of empty output are what a working producer looks like, not a
|
|
48
|
+
* standstill. Nothing on the step records the branch tip, so there is no second signal to fall
|
|
49
|
+
* back on: the honest answer is that this rule cannot speak for that pair.
|
|
50
|
+
* - **The rework was this loop's own.** `requestedBy: 'reviewer'` covers the automatic rounds and
|
|
51
|
+
* the extra round a human grants (which the companion's verdict still drives). A human "request
|
|
52
|
+
* changes" cycle lands on the same `rework` field with `requestedBy: 'human'` and consumes NO
|
|
53
|
+
* attempts, so concluding a standstill from it would abandon an automatic budget that was never
|
|
54
|
+
* spent, over a round nobody here asked for.
|
|
55
|
+
* - **The producer did not change the work.** Its current `output` normalises to the same text as
|
|
56
|
+
* the `previousProposal` it was handed to revise. That is the only signal available here that
|
|
57
|
+
* is about the WORK rather than about an opinion of it.
|
|
58
|
+
* - **The rating did not move.** Compared against the previous cycle's verdict, within
|
|
59
|
+
* {@link RATING_EPSILON}. A rating that MOVED on unchanged text means the grader has changed
|
|
60
|
+
* its mind, and the next round can legitimately differ, so the loop is left alone.
|
|
61
|
+
*
|
|
62
|
+
* Requiring all of them is what keeps this from firing on the ordinary cases it would otherwise
|
|
63
|
+
* ruin: a first round always has no predecessor to compare against, and a producer that made a
|
|
64
|
+
* small edit for a rating that stayed flat is still working. The cost of a false NEGATIVE is one
|
|
65
|
+
* wasted round, already bounded by `maxAttempts`; the cost of a false positive is a run cut short
|
|
66
|
+
* with work left undone, so every branch errs the cheap way.
|
|
67
|
+
*
|
|
68
|
+
* Deliberately NOT keyed on the number of rounds a finding has stayed open. A companion that keeps
|
|
69
|
+
* raising the same point at a producer that keeps arguing back is a loop doing exactly what the
|
|
70
|
+
* feedback-accounting directives ask of it, and stopping that would punish the disagreement
|
|
71
|
+
* channel those exist to provide.
|
|
72
|
+
*/
|
|
73
|
+
export function companionLoopStalled(args) {
|
|
74
|
+
const { producer, verdicts, producerDeliverableIsReply } = args;
|
|
75
|
+
if (!producer || !producerDeliverableIsReply || verdicts.length < 2)
|
|
76
|
+
return false;
|
|
77
|
+
const current = verdicts[verdicts.length - 1];
|
|
78
|
+
const previous = verdicts[verdicts.length - 2];
|
|
79
|
+
if (!current || !previous)
|
|
80
|
+
return false;
|
|
81
|
+
if (Math.abs(current.rating - previous.rating) > RATING_EPSILON)
|
|
82
|
+
return false;
|
|
83
|
+
// No `rework` means this producer was never looped back, so there is no "what it was asked to
|
|
84
|
+
// change" to compare its output against, and nothing here can be concluded. A rework somebody
|
|
85
|
+
// ELSE asked for is not this loop's evidence either.
|
|
86
|
+
const rework = producer.rework;
|
|
87
|
+
if (!rework || rework.requestedBy !== 'reviewer')
|
|
88
|
+
return false;
|
|
89
|
+
return normalizeProposal(producer.output ?? '') === normalizeProposal(rework.previousProposal);
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=companionProgress.logic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companionProgress.logic.js","sourceRoot":"","sources":["../../../src/modules/execution/companionProgress.logic.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,EAAE;AACF,+FAA+F;AAC/F,gGAAgG;AAChG,kGAAkG;AAClG,gGAAgG;AAChG,6FAA6F;AAC7F,+BAA+B;AAC/B,EAAE;AACF,gGAAgG;AAChG,+FAA+F;AAC/F,4FAA4F;AAE5F;;;;;;GAMG;AACH,MAAM,cAAc,GAAG,IAAI,CAAA;AAE3B;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,IAAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC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IENT_EVICTION_RECOVERIES = 5;
|
|
51
|
+
/**
|
|
52
|
+
* Recovery budget for a step whose push to the work branch was REFUSED because the branch moved
|
|
53
|
+
* under it (the harness reports `branch-contended`). Re-dispatching resumes the branch as it now
|
|
54
|
+
* stands, which is exactly what resolves the race the rejection reports: the other writer's
|
|
55
|
+
* commits are already there, so the agent works on top of them instead of against them.
|
|
56
|
+
*
|
|
57
|
+
* Set to 1, and deliberately lower than the transient-eviction budget: the two failure shapes look
|
|
58
|
+
* alike but recur differently. Infra churn is a window that passes, whereas the one contention
|
|
59
|
+
* shape the harness cannot resolve itself is an agent REWRITING history it did not publish, which
|
|
60
|
+
* is deterministic, so a second attempt does the same thing again. One retry buys the genuine race
|
|
61
|
+
* its resolution without funding a loop, and the failure past it names the cause precisely.
|
|
62
|
+
*/
|
|
63
|
+
export declare const MAX_BRANCH_CONTENTION_RECOVERIES = 1;
|
|
51
64
|
/**
|
|
52
65
|
* Throttle window (ms) for persisting a container step's liveness heartbeat as its
|
|
53
66
|
* `lastActivityAt`. The harness heartbeat advances on every stdout chunk and the driver polls
|
|
@@ -108,6 +121,13 @@ export interface DispatchFailureContext {
|
|
|
108
121
|
evictionRecoveries?: number;
|
|
109
122
|
/** Transient-churn recoveries already spent — same "work had begun" signal as above. */
|
|
110
123
|
transientEvictionRecoveries?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Branch-contention recoveries already spent (see `MAX_BRANCH_CONTENTION_RECOVERIES`). The third
|
|
126
|
+
* "work had begun" signal, and the STRONGEST of them: a refused push is proof the step's commits
|
|
127
|
+
* are on the remote branch already, where an eviction only proves the container reached the agent
|
|
128
|
+
* phase. It gets its own message rather than the eviction one because nothing was evicted.
|
|
129
|
+
*/
|
|
130
|
+
branchContentionRecoveries?: number;
|
|
111
131
|
/** Epoch ms the step first began executing, to render "after N minutes of work". */
|
|
112
132
|
startedAt?: number | null;
|
|
113
133
|
/** Slices the reviewer had already grouped the diff into (partial progress), if any. */
|
|
@@ -139,6 +159,10 @@ export interface DispatchFailureContext {
|
|
|
139
159
|
* the failed recovery re-dispatch of a container that reached the agent phase and was then
|
|
140
160
|
* evicted) is framed as `evicted` with an eviction-after-work message, NOT the misleading
|
|
141
161
|
* "container failed to start" (which reads as "never started"). See ADR 0026 D1.
|
|
162
|
+
* - A generic throw on the re-dispatch after a REFUSED work-branch push
|
|
163
|
+
* (`context.branchContentionRecoveries > 0`) is the same misattribution to avoid, with a
|
|
164
|
+
* stronger history behind it: the step's commits are already on the branch. It keeps the
|
|
165
|
+
* `dispatch` kind (no container was evicted) and says what it was resuming.
|
|
142
166
|
* - Anything else is a genuine container accept failure (`dispatch`): the container/runner
|
|
143
167
|
* never accepted the job (an HTTP/network error, a capacity blip) before any work happened.
|
|
144
168
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/job.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAGlF;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wFAAwF;IACxF,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,IAAI,CAAA;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAA;AAElD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAIT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE3E;AAED,iGAAiG;AACjG,MAAM,WAAW,6BAA6B;IAC5C,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,WAAW,EAAE,gBAAgB,CAAA;IAC7B,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAA;IACd,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,wFAAwF;IACxF,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mFAAmF;IACnF,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;
|
|
1
|
+
{"version":3,"file":"job.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/job.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAGlF;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wFAAwF;IACxF,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,MAA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ACnC,6BAA6B,CAmC/B"}
|
|
@@ -36,6 +36,19 @@ export const MAX_EVICTION_RECOVERIES = 1;
|
|
|
36
36
|
* node drain or a placement move).
|
|
37
37
|
*/
|
|
38
38
|
export const MAX_TRANSIENT_EVICTION_RECOVERIES = 5;
|
|
39
|
+
/**
|
|
40
|
+
* Recovery budget for a step whose push to the work branch was REFUSED because the branch moved
|
|
41
|
+
* under it (the harness reports `branch-contended`). Re-dispatching resumes the branch as it now
|
|
42
|
+
* stands, which is exactly what resolves the race the rejection reports: the other writer's
|
|
43
|
+
* commits are already there, so the agent works on top of them instead of against them.
|
|
44
|
+
*
|
|
45
|
+
* Set to 1, and deliberately lower than the transient-eviction budget: the two failure shapes look
|
|
46
|
+
* alike but recur differently. Infra churn is a window that passes, whereas the one contention
|
|
47
|
+
* shape the harness cannot resolve itself is an agent REWRITING history it did not publish, which
|
|
48
|
+
* is deterministic, so a second attempt does the same thing again. One retry buys the genuine race
|
|
49
|
+
* its resolution without funding a loop, and the failure past it names the cause precisely.
|
|
50
|
+
*/
|
|
51
|
+
export const MAX_BRANCH_CONTENTION_RECOVERIES = 1;
|
|
39
52
|
/**
|
|
40
53
|
* Throttle window (ms) for persisting a container step's liveness heartbeat as its
|
|
41
54
|
* `lastActivityAt`. The harness heartbeat advances on every stdout chunk and the driver polls
|
|
@@ -92,14 +105,28 @@ function elapsedWorkMinutes(context) {
|
|
|
92
105
|
* board and PR-review window can render "work was in progress".
|
|
93
106
|
*/
|
|
94
107
|
function evictionAfterWorkMessage(context) {
|
|
95
|
-
const minutes = elapsedWorkMinutes(context);
|
|
96
|
-
const when = minutes != null
|
|
97
|
-
? `after ${minutes} minute${minutes === 1 ? '' : 's'} of work`
|
|
98
|
-
: 'after work had begun';
|
|
99
108
|
const slices = context.sliceCount && context.sliceCount > 0
|
|
100
109
|
? ` (${context.sliceCount} slice${context.sliceCount === 1 ? '' : 's'} reviewed)`
|
|
101
110
|
: '';
|
|
102
|
-
return `The container was evicted ${
|
|
111
|
+
return `The container was evicted ${whenWorkHadBegun(context)}${slices} and could not be recovered.`;
|
|
112
|
+
}
|
|
113
|
+
/** "after N minutes of work", or the vaguer form when no start clock was recorded. */
|
|
114
|
+
function whenWorkHadBegun(context) {
|
|
115
|
+
const minutes = elapsedWorkMinutes(context);
|
|
116
|
+
return minutes != null
|
|
117
|
+
? `after ${minutes} minute${minutes === 1 ? '' : 's'} of work`
|
|
118
|
+
: 'after work had begun';
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The honest terminal message for the re-dispatch of a step whose work-branch push was REFUSED
|
|
122
|
+
* failing to start. Nothing was evicted here, so it keeps the `dispatch` framing, but it must not
|
|
123
|
+
* read as "never started": the step's commits are on the remote branch already, which is precisely
|
|
124
|
+
* what the refused push proved.
|
|
125
|
+
*/
|
|
126
|
+
function contentionAfterWorkMessage(context) {
|
|
127
|
+
return (`The container failed to start when resuming this step ${whenWorkHadBegun(context)}, ` +
|
|
128
|
+
'after its push to the work branch was refused. The commits it had already pushed are on the ' +
|
|
129
|
+
'branch.');
|
|
103
130
|
}
|
|
104
131
|
/**
|
|
105
132
|
* Classify a throw from an async agent dispatch (`startJob`) into a terminal failure. The
|
|
@@ -125,6 +152,10 @@ function evictionAfterWorkMessage(context) {
|
|
|
125
152
|
* the failed recovery re-dispatch of a container that reached the agent phase and was then
|
|
126
153
|
* evicted) is framed as `evicted` with an eviction-after-work message, NOT the misleading
|
|
127
154
|
* "container failed to start" (which reads as "never started"). See ADR 0026 D1.
|
|
155
|
+
* - A generic throw on the re-dispatch after a REFUSED work-branch push
|
|
156
|
+
* (`context.branchContentionRecoveries > 0`) is the same misattribution to avoid, with a
|
|
157
|
+
* stronger history behind it: the step's commits are already on the branch. It keeps the
|
|
158
|
+
* `dispatch` kind (no container was evicted) and says what it was resuming.
|
|
128
159
|
* - Anything else is a genuine container accept failure (`dispatch`): the container/runner
|
|
129
160
|
* never accepted the job (an HTTP/network error, a capacity blip) before any work happened.
|
|
130
161
|
*/
|
|
@@ -156,6 +187,12 @@ export function classifyDispatchFailure(error, context = {}) {
|
|
|
156
187
|
if (recoveries > 0) {
|
|
157
188
|
return { error: evictionAfterWorkMessage(context), failureKind: 'evicted', detail: message };
|
|
158
189
|
}
|
|
190
|
+
// Same reasoning, different history: this is the re-dispatch after a REFUSED work-branch push, so
|
|
191
|
+
// the step's work is not merely begun but pushed. It stays a `dispatch` failure (nothing was
|
|
192
|
+
// evicted) with a message that says so.
|
|
193
|
+
if ((context.branchContentionRecoveries ?? 0) > 0) {
|
|
194
|
+
return { error: contentionAfterWorkMessage(context), failureKind: 'dispatch', detail: message };
|
|
195
|
+
}
|
|
159
196
|
return { error: 'The container failed to start.', failureKind: 'dispatch', detail: message };
|
|
160
197
|
}
|
|
161
198
|
//# sourceMappingURL=job.logic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.logic.js","sourceRoot":"","sources":["../../../src/modules/execution/job.logic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAqBjF;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAyB,EACzB,IAAwB;IAExB,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IACvB,OAAO,oBAAoB,KAAK,wBAAwB,IAAI,EAAE,CAAA;AAChE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAA;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAA;AAElD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAiC,EACjC,QAA4B;IAE5B,IAAI,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,OAAO,EAAE,KAAK,EAAE,wBAAwB,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;IAC9F,CAAC;IACD,kGAAkG;IAClG,6FAA6F;IAC7F,wCAAwC;IACxC,IAAI,CAAC,OAAO,CAAC,0BAA0B,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,0BAA0B,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;IACjG,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,gCAAgC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;AAC9F,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BlockRepository, Clock, ExecutionEventPublisher, ExecutionInstance, IdGenerator, KaizenGrading, KaizenGradingRepository, KaizenOverview, KaizenVerifiedComboRepository, LlmCallMetricRepository, ModelProvider, ModelProviderResolver, ModelRef, WorkspaceSettingsRepository } from '@cat-factory/kernel';
|
|
1
|
+
import type { AgentContextSnapshot, BlockRepository, Clock, ExecutionEventPublisher, ExecutionInstance, IdGenerator, KaizenGrading, KaizenGradingRepository, KaizenOverview, KaizenVerifiedComboRepository, LlmCallMetric, LlmCallMetricRepository, ModelProvider, ModelProviderResolver, ModelRef, WorkspaceSettingsRepository } from '@cat-factory/kernel';
|
|
2
2
|
import type { AgentContextObservabilityService } from '../observability/AgentContextObservabilityService.js';
|
|
3
3
|
import { type InlineBlockModelDeps } from '../../inlineBlockModel.js';
|
|
4
4
|
export interface KaizenServiceDependencies {
|
|
@@ -84,4 +84,6 @@ export declare class KaizenService {
|
|
|
84
84
|
private fail;
|
|
85
85
|
private emit;
|
|
86
86
|
}
|
|
87
|
+
/** Build the grader's user prompt: the provided context + an interaction-telemetry digest. */
|
|
88
|
+
export declare function buildKaizenPrompt(grading: KaizenGrading, snapshot: AgentContextSnapshot | null, calls: LlmCallMetric[]): string;
|
|
87
89
|
//# sourceMappingURL=KaizenService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaizenService.d.ts","sourceRoot":"","sources":["../../../src/modules/kaizen/KaizenService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"KaizenService.d.ts","sourceRoot":"","sources":["../../../src/modules/kaizen/KaizenService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,KAAK,EACL,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,cAAc,EACd,6BAA6B,EAC7B,aAAa,EACb,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,QAAQ,EAER,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAa5B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAA;AAC5G,OAAO,EAAE,KAAK,oBAAoB,EAA8B,MAAM,2BAA2B,CAAA;AASjG,MAAM,WAAW,yBAAyB;IACxC,uBAAuB,EAAE,uBAAuB,CAAA;IAChD,6BAA6B,EAAE,6BAA6B,CAAA;IAC5D,eAAe,EAAE,eAAe,CAAA;IAChC,uBAAuB,EAAE,uBAAuB,CAAA;IAChD,6FAA6F;IAC7F,yBAAyB,EAAE,gCAAgC,CAAA;IAC3D,gFAAgF;IAChF,2BAA2B,CAAC,EAAE,2BAA2B,CAAA;IACzD,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,KAAK,CAAA;IACZ,qFAAqF;IACrF,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,qFAAqF;IACrF,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,kFAAkF;IAClF,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,kFAAkF;IAClF,QAAQ,CAAC,EAAE,QAAQ,CAAA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C,KAAK,EAAE,aAAa,EAAE,GACrB,MAAM,CAyCR"}
|
|
@@ -271,7 +271,7 @@ function parseVerdict(text) {
|
|
|
271
271
|
return { grade, summary, recommendations };
|
|
272
272
|
}
|
|
273
273
|
/** Build the grader's user prompt: the provided context + an interaction-telemetry digest. */
|
|
274
|
-
function buildKaizenPrompt(grading, snapshot, calls) {
|
|
274
|
+
export function buildKaizenPrompt(grading, snapshot, calls) {
|
|
275
275
|
const parts = [];
|
|
276
276
|
parts.push(`Grade this completed agent step.\n` +
|
|
277
277
|
`Agent kind: ${grading.agentKind}\nModel: ${grading.model}\nPrompt version: ${grading.promptVersion}`);
|
|
@@ -290,29 +290,78 @@ function buildKaizenPrompt(grading, snapshot, calls) {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
else {
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
// Names no cause. It used to guess one ("prompt recording may be off"), which was wrong for
|
|
294
|
+
// every INLINE kind — nothing recorded snapshots for those at all until the inline executor
|
|
295
|
+
// gained a recorder — and a grader handed a cause duly recommended enabling a switch that was
|
|
296
|
+
// already enabled. Three causes remain reachable: recording genuinely off, a step whose dispatch
|
|
297
|
+
// predates the recorder, and a step whose work was an inline service call rather than a kind
|
|
298
|
+
// dispatch (the judges, the requirements reviewer, this grader itself — see
|
|
299
|
+
// `inline-context-record.ts`). Nothing here can tell them apart, so it says so.
|
|
300
|
+
parts.push('No provided-context snapshot is available for this step, so the system prompt and ' +
|
|
301
|
+
'injected context CANNOT be assessed. Do not infer why, and do not grade their quality ' +
|
|
302
|
+
'either way: grade only what the interaction telemetry below supports.');
|
|
295
303
|
}
|
|
296
304
|
parts.push(`=== INTERACTION TELEMETRY ===\n${digestCalls(calls)}`);
|
|
297
305
|
return parts.join('\n\n');
|
|
298
306
|
}
|
|
299
|
-
/**
|
|
307
|
+
/**
|
|
308
|
+
* A compact, model-readable digest of the per-call telemetry for one step.
|
|
309
|
+
*
|
|
310
|
+
* Two things here are stated carefully because the grader REASONS about them and, told them
|
|
311
|
+
* loosely, spends a whole recommendation on a defect that does not exist.
|
|
312
|
+
*
|
|
313
|
+
* **The input side is three orthogonal classes, never `promptTokens` alone.** That field is FRESH
|
|
314
|
+
* (uncached) input by definition (`token-telemetry-per-class-and-cost.md` slice 1), so on a
|
|
315
|
+
* prompt-cached subscription run it is a handful of tokens per call while the real input is
|
|
316
|
+
* hundreds of thousands. Reported as "Prompt tokens (sum)" it read as 16 against a true 332,552,
|
|
317
|
+
* and the grader correctly concluded that no such call could exist and filed "fix prompt-token
|
|
318
|
+
* accounting" against telemetry that was in fact recording it exactly.
|
|
319
|
+
*
|
|
320
|
+
* **An absent finish reason is reported as absent, never folded into a value.** Neither
|
|
321
|
+
* subscription CLI reports one, so `truncated` is not 0 on those runs, it is UNKNOWABLE, and a
|
|
322
|
+
* flat "Truncated calls: 0" is the "absent is not zero" trap: it invites the grader to certify a
|
|
323
|
+
* step as cleanly completed on evidence nobody collected. That holds for the MIXED case too, which
|
|
324
|
+
* is why the truncation count carries its own denominator on the same line rather than an absolute
|
|
325
|
+
* over whichever subset happened to report: "0" beside "8 calls" reads as a clean step even when
|
|
326
|
+
* seven of the eight measured nothing.
|
|
327
|
+
*/
|
|
300
328
|
function digestCalls(calls) {
|
|
301
329
|
if (calls.length === 0)
|
|
302
330
|
return 'No LLM calls were recorded for this step.';
|
|
303
|
-
const truncated = calls.filter((c) => c.finishReason === 'length').length;
|
|
304
331
|
const errors = calls.filter((c) => !c.ok).length;
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
const
|
|
332
|
+
const sum = (read) => calls.reduce((total, call) => total + read(call), 0);
|
|
333
|
+
const fresh = sum((c) => c.promptTokens);
|
|
334
|
+
const cacheRead = sum((c) => c.cacheReadTokens);
|
|
335
|
+
const cacheWrite = sum((c) => c.cacheWriteTokens);
|
|
336
|
+
const completionTokens = sum((c) => c.completionTokens);
|
|
337
|
+
// Narrowed by a predicate, so the finish reasons below are strings and there is no `?? ''` to
|
|
338
|
+
// read as a guard: an unlabelled histogram entry is exactly what this digest must not print.
|
|
339
|
+
const reported = calls.filter((c) => {
|
|
340
|
+
return c.finishReason != null;
|
|
341
|
+
});
|
|
342
|
+
const silent = calls.length - reported.length;
|
|
308
343
|
const lines = [
|
|
309
344
|
`Total model calls: ${calls.length}`,
|
|
310
|
-
`Truncated calls (hit output limit): ${truncated}`,
|
|
311
345
|
`Failed calls: ${errors}`,
|
|
312
|
-
`
|
|
346
|
+
`Input tokens (sum): ${fresh + cacheRead + cacheWrite} ` +
|
|
347
|
+
`(${fresh} fresh + ${cacheRead} cache reads + ${cacheWrite} cache writes)`,
|
|
313
348
|
`Completion tokens (sum): ${completionTokens}`,
|
|
314
|
-
`Finish reasons: ${finishReasons}`,
|
|
315
349
|
];
|
|
350
|
+
if (reported.length === 0) {
|
|
351
|
+
lines.push('Finish reasons: NOT REPORTED by this model backend for any call. Whether any call was ' +
|
|
352
|
+
'truncated at its output limit is therefore unknown, not known to be none. Do not treat ' +
|
|
353
|
+
'these calls as having completed cleanly, and do not report this as a telemetry defect: ' +
|
|
354
|
+
'the subscription agent CLIs expose no per-call stop reason.');
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
const truncated = reported.filter((c) => c.finishReason === 'length').length;
|
|
358
|
+
lines.push(`Truncated calls (hit output limit): ${truncated} of the ${reported.length} call(s) that ` +
|
|
359
|
+
`reported a finish reason` +
|
|
360
|
+
(silent > 0
|
|
361
|
+
? `; the other ${silent} reported none, so truncation is UNKNOWN for those and this ` +
|
|
362
|
+
`count is not a step-wide total`
|
|
363
|
+
: ''), `Finish reasons: ${summarizeCounts(reported.map((c) => c.finishReason))}`);
|
|
364
|
+
}
|
|
316
365
|
const last = calls[0]; // newest first
|
|
317
366
|
if (last?.responseText) {
|
|
318
367
|
lines.push(`Final visible response (truncated to 2000 chars):\n${last.responseText.slice(0, 2000)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaizenService.js","source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SAAS,eAAe,CAAC,MAAgB;IACvC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAA;IACxC,KAAK,MAAM,CAAC,IAAI,MAAM;QAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAC/D,OAAO,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACtE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentContextRecorder, AgentContextSnapshot, AgentContextSnapshotRepository, Clock, IdGenerator, RecordAgentContextInput, WorkspaceSettingsRepository } from '@cat-factory/kernel';
|
|
1
|
+
import type { AgentContextRecorder, AgentContextSnapshot, AgentContextSnapshotRepository, Clock, GroupCacheHandle, IdGenerator, RecordAgentContextInput, WorkspaceSettingsCacheValue, WorkspaceSettingsRepository } from '@cat-factory/kernel';
|
|
2
2
|
/**
|
|
3
3
|
* Defensive upper bound (characters) on any single stored body — a prompt or one
|
|
4
4
|
* injected file. Real agent context sits far below this; the cap exists only so a
|
|
@@ -29,6 +29,16 @@ export interface AgentContextObservabilityServiceDependencies {
|
|
|
29
29
|
workspaceSettingsRepository: WorkspaceSettingsRepository;
|
|
30
30
|
idGenerator: IdGenerator;
|
|
31
31
|
clock: Clock;
|
|
32
|
+
/**
|
|
33
|
+
* The shared `AppCaches.workspaceSettings` slice, when the facade has one.
|
|
34
|
+
*
|
|
35
|
+
* The per-workspace gate below is asked once per RECORDED DISPATCH, and an inline dispatch waits
|
|
36
|
+
* on it before its model call (see `recordInlineAgentContext`), so on a run made of inline steps
|
|
37
|
+
* an uncached read is a settings SELECT per step — a mothership node reaches it over the
|
|
38
|
+
* `/internal/persistence` RPC. Absent ⇒ a direct repository read, which is the Worker's situation
|
|
39
|
+
* and costs nothing there: the slice is `enabled: false` in the isolate-safe profile.
|
|
40
|
+
*/
|
|
41
|
+
workspaceSettingsCache?: GroupCacheHandle<WorkspaceSettingsCacheValue>;
|
|
32
42
|
/**
|
|
33
43
|
* The deployment's prompt-recording switch (`LLM_RECORD_PROMPTS`, default true). When
|
|
34
44
|
* false the operator has opted out of retaining prompt text, so the full agent
|
|
@@ -48,16 +58,17 @@ export interface AgentContextObservabilityServiceDependencies {
|
|
|
48
58
|
*
|
|
49
59
|
* Storing is gated twice: the deployment-wide prompt-recording switch
|
|
50
60
|
* ({@link recordPrompts}) AND the per-workspace `storeAgentContext` setting must both be
|
|
51
|
-
* enabled
|
|
52
|
-
*
|
|
61
|
+
* enabled, the second through kernel's shared {@link createStoreAgentContextGate} (the one
|
|
62
|
+
* implementation every body-capturing path asks). Wired only when a snapshot repository is present,
|
|
63
|
+
* so tests and unconfigured facades collect nothing.
|
|
53
64
|
*/
|
|
54
65
|
export declare class AgentContextObservabilityService implements AgentContextRecorder {
|
|
55
66
|
private readonly repository;
|
|
56
|
-
private readonly
|
|
67
|
+
private readonly storeEnabled;
|
|
57
68
|
private readonly idGenerator;
|
|
58
69
|
private readonly clock;
|
|
59
70
|
private readonly recordPrompts;
|
|
60
|
-
constructor({ agentContextSnapshotRepository, workspaceSettingsRepository, idGenerator, clock, recordPrompts, }: AgentContextObservabilityServiceDependencies);
|
|
71
|
+
constructor({ agentContextSnapshotRepository, workspaceSettingsRepository, workspaceSettingsCache, idGenerator, clock, recordPrompts, }: AgentContextObservabilityServiceDependencies);
|
|
61
72
|
/**
|
|
62
73
|
* Persist one dispatch's context, assigning its id + timestamp. Returns without
|
|
63
74
|
* storing when prompt recording is disabled deployment-wide or the workspace has
|
|
@@ -81,6 +92,5 @@ export declare class AgentContextObservabilityService implements AgentContextRec
|
|
|
81
92
|
record(input: RecordAgentContextInput): Promise<void>;
|
|
82
93
|
/** Snapshots recorded for a run, newest first (for the observability drill-down). */
|
|
83
94
|
listByExecution(workspaceId: string, executionId: string): Promise<AgentContextSnapshot[]>;
|
|
84
|
-
private storeEnabled;
|
|
85
95
|
}
|
|
86
96
|
//# sourceMappingURL=AgentContextObservabilityService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentContextObservabilityService.d.ts","sourceRoot":"","sources":["../../../src/modules/observability/AgentContextObservabilityService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,EAC9B,KAAK,EACL,WAAW,EACX,uBAAuB,
|
|
1
|
+
{"version":3,"file":"AgentContextObservabilityService.d.ts","sourceRoot":"","sources":["../../../src/modules/observability/AgentContextObservabilityService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,EAC9B,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EAEvB,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAQ5B;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAAa,CAAA;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,QAAkB,CAAA;AAO5D;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,yDAAyD,CAAA;AAuB7F,MAAM,WAAW,4CAA4C;IAC3D,8BAA8B,EAAE,8BAA8B,CAAA;IAC9D,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,KAAK,CAAA;IACZ;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,gBAAgB,CAAC,2BAA2B,CAAC,CAAA;IACtE;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gCAAiC,YAAW,oBAAoB;IA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