@cat-factory/agents 0.140.1 → 0.142.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/dist/agents/catalog.d.ts +9 -1
- package/dist/agents/catalog.d.ts.map +1 -1
- package/dist/agents/catalog.js +130 -20
- package/dist/agents/catalog.js.map +1 -1
- package/dist/agents/kinds/built-in-container.d.ts.map +1 -1
- package/dist/agents/kinds/built-in-container.js +46 -1
- package/dist/agents/kinds/built-in-container.js.map +1 -1
- package/dist/agents/kinds/pr-review-context.d.ts +27 -1
- package/dist/agents/kinds/pr-review-context.d.ts.map +1 -1
- package/dist/agents/kinds/pr-review-context.js +26 -0
- package/dist/agents/kinds/pr-review-context.js.map +1 -1
- package/dist/agents/kinds/pr-reviewer.d.ts +1 -1
- package/dist/agents/kinds/pr-reviewer.d.ts.map +1 -1
- package/dist/agents/kinds/pr-reviewer.js +1 -1
- package/dist/agents/kinds/pr-reviewer.js.map +1 -1
- package/dist/agents/kinds/traits.d.ts +47 -4
- package/dist/agents/kinds/traits.d.ts.map +1 -1
- package/dist/agents/kinds/traits.js +49 -4
- package/dist/agents/kinds/traits.js.map +1 -1
- package/dist/agents/prompts/bespoke-kinds.d.ts +8 -1
- package/dist/agents/prompts/bespoke-kinds.d.ts.map +1 -1
- package/dist/agents/prompts/bespoke-kinds.js +8 -2
- package/dist/agents/prompts/bespoke-kinds.js.map +1 -1
- package/dist/agents/prompts/built-in-container.d.ts +27 -0
- package/dist/agents/prompts/built-in-container.d.ts.map +1 -1
- package/dist/agents/prompts/built-in-container.js +68 -0
- package/dist/agents/prompts/built-in-container.js.map +1 -1
- package/dist/agents/prompts/companion.d.ts +39 -1
- package/dist/agents/prompts/companion.d.ts.map +1 -1
- package/dist/agents/prompts/companion.js +100 -5
- package/dist/agents/prompts/companion.js.map +1 -1
- package/dist/agents/prompts/review-rounds.d.ts +8 -1
- package/dist/agents/prompts/review-rounds.d.ts.map +1 -1
- package/dist/agents/prompts/review-rounds.js +49 -1
- package/dist/agents/prompts/review-rounds.js.map +1 -1
- package/dist/agents/prompts/roles.d.ts +12 -0
- package/dist/agents/prompts/roles.d.ts.map +1 -1
- package/dist/agents/prompts/roles.js +22 -0
- package/dist/agents/prompts/roles.js.map +1 -1
- package/dist/agents/runtime/executor.d.ts.map +1 -1
- package/dist/agents/runtime/executor.js +8 -3
- package/dist/agents/runtime/executor.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-reviewer.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/pr-reviewer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAkD3E,eAAO,MAAM,gBAAgB,gBAAgB,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;EAAoD,CAAA;AAEzE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;AAyB9D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAA;AA+E7C,eAAO,MAAM,yBAAyB,QAsEK,CAAA;AAE3C,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,EA6CxD,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAEzE;AAED,OAAO,EACL,oBAAoB,EACpB,iCAAiC,EACjC,4BAA4B,EAC5B,+BAA+B,EAC/B,UAAU,EACV,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,wBAAwB,EACxB,KAAK,cAAc,GACpB,MAAM,wBAAwB,CAAA"}
|
|
1
|
+
{"version":3,"file":"pr-reviewer.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/pr-reviewer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAkD3E,eAAO,MAAM,gBAAgB,gBAAgB,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;EAAoD,CAAA;AAEzE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;AAyB9D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAA;AA+E7C,eAAO,MAAM,yBAAyB,QAsEK,CAAA;AAE3C,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,EA6CxD,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAEzE;AAED,OAAO,EACL,oBAAoB,EACpB,iCAAiC,EACjC,4BAA4B,EAC5B,+BAA+B,EAC/B,UAAU,EACV,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,KAAK,cAAc,GACpB,MAAM,wBAAwB,CAAA"}
|
|
@@ -286,5 +286,5 @@ export const PR_REVIEWER_AGENT_KINDS = [
|
|
|
286
286
|
export function registerPrReviewerAgent(registry) {
|
|
287
287
|
registry.registerAll(PR_REVIEWER_AGENT_KINDS);
|
|
288
288
|
}
|
|
289
|
-
export { PR_DIFF_CONTEXT_FILE, PR_EXISTING_COMMENTS_CONTEXT_FILE, PR_PRIOR_REVIEW_CONTEXT_FILE, PR_STANDARDS_INDEX_CONTEXT_FILE, planSlices, prReviewerDiffPreOp, prReviewerExistingCommentsPreOp, prReviewerStandardsPreOp, renderExistingReviewComments, renderPrDiffContext, renderPriorReviewContext, renderStandardContext, renderStandardsIndex, resolvePrNumber, standardsContextFileName, } from './pr-review-context.js';
|
|
289
|
+
export { PR_DIFF_CONTEXT_FILE, PR_EXISTING_COMMENTS_CONTEXT_FILE, PR_PRIOR_REVIEW_CONTEXT_FILE, PR_STANDARDS_INDEX_CONTEXT_FILE, planSlices, prReviewerDiffPreOp, prReviewerExistingCommentsPreOp, prReviewerStandardsPreOp, renderExistingReviewComments, renderPrDiffContext, renderPriorReviewContext, renderStandardContext, renderStandardsIndex, resolvePrHeadNumber, resolvePrNumber, standardsContextFileName, } from './pr-review-context.js';
|
|
290
290
|
//# sourceMappingURL=pr-reviewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-reviewer.js","sourceRoot":"","sources":["../../../src/agents/kinds/pr-reviewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,yCAAyC,EAAE,MAAM,sBAAsB,CAAA;AAChF,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,wBAAwB,CAAA;AAE/B,8EAA8E;AAC9E,kFAAkF;AAClF,iFAAiF;AACjF,kCAAkC;AAClC,EAAE;AACF,kFAAkF;AAClF,kFAAkF;AAClF,6EAA6E;AAC7E,oFAAoF;AACpF,uFAAuF;AACvF,yFAAyF;AACzF,EAAE;AACF,6FAA6F;AAC7F,2FAA2F;AAC3F,6FAA6F;AAC7F,yFAAyF;AACzF,sFAAsF;AACtF,0CAA0C;AAC1C,EAAE;AACF,6FAA6F;AAC7F,6FAA6F;AAC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EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QAC5F,8FAA8F;QAC9F,4FAA4F;QAC5F,+FAA+F;QAC/F,4FAA4F;QAC5F,mEAAmE;QACnE,yFAAyF;QACzF,gFAAgF;QAChF,8FAA8F;QAC9F,0EAA0E;QAC1E,MAAM,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;QAC/C,6FAA6F;QAC7F,2FAA2F;QAC3F,0FAA0F;QAC1F,6EAA6E;QAC7E,iBAAiB,EAAE,eAAe;QAClC,gBAAgB,EAAE,QAAQ;QAC1B,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,SAAS;YAChB,WAAW,EACT,wFAAwF;gBACxF,yDAAyD;YAC3D,QAAQ,EAAE,QAAQ;YAClB,8EAA8E;YAC9E,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;YAC7B,IAAI,EAAE,OAAO;YACb,mFAAmF;YACnF,iFAAiF;YACjF,UAAU,EAAE,WAAW;SACxB;KACF;CACF,CAAA;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,QAAQ,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAA;AAC/C,CAAC;AAED,OAAO,EACL,oBAAoB,EACpB,iCAAiC,EACjC,4BAA4B,EAC5B,+BAA+B,EAC/B,UAAU,EACV,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,GAEzB,MAAM,wBAAwB,CAAA"}
|
|
@@ -161,17 +161,56 @@ export declare const SPEC_AWARE_GUIDANCE: string;
|
|
|
161
161
|
* `reviewer` companion is a built-in listed here while the coder declares its own).
|
|
162
162
|
*/
|
|
163
163
|
export declare const STANDARD_AGENT_TRAITS: Partial<Record<AgentKind, AgentTrait[]>>;
|
|
164
|
+
/**
|
|
165
|
+
* What a dispatch actually PUT IN FRONT OF the agent, for guidance that names an artifact.
|
|
166
|
+
*
|
|
167
|
+
* Trait guidance is composed from the kind alone, and several of these strings point at a
|
|
168
|
+
* `.cat-context/` file the ENGINE decides whether to inject. When the injection did not happen
|
|
169
|
+
* the guidance is a pointer to a path that does not exist, which reads to the agent as a platform
|
|
170
|
+
* fault rather than as an absence, and the graders kept filing it: a ~200-word reuse mandate
|
|
171
|
+
* riding every turn of a run whose deployment has no catalog to reuse from.
|
|
172
|
+
*
|
|
173
|
+
* `contextPaths` absent means the CALLER DOES NOT KNOW, not that nothing was delivered, and those
|
|
174
|
+
* are opposite facts. The prompt editor measuring what the platform appends to an override, the
|
|
175
|
+
* sandbox composing a candidate and a test asking for a kind's prompt all legitimately have no
|
|
176
|
+
* dispatch, and each renders the guidance in FULL. That direction of the error is the safe one, the
|
|
177
|
+
* same reasoning `containerDispatchDirectivesFor` records: over-reporting a rule a workspace cannot
|
|
178
|
+
* delete costs a line in an editor, under-reporting hides one.
|
|
179
|
+
*/
|
|
180
|
+
export interface TraitDelivery {
|
|
181
|
+
/**
|
|
182
|
+
* The `.cat-context/` paths this dispatch injected, or `undefined` when unknown. An empty array
|
|
183
|
+
* is a real answer: the dispatch injected nothing.
|
|
184
|
+
*/
|
|
185
|
+
contextPaths?: readonly string[];
|
|
186
|
+
}
|
|
164
187
|
/** Definition of a (custom) trait: its id and optional system-prompt guidance. */
|
|
165
188
|
export interface AgentTraitDefinition {
|
|
166
189
|
/** The trait id used in `STANDARD_AGENT_TRAITS` / `AgentKindDefinition.traits`. */
|
|
167
190
|
id: AgentTrait;
|
|
168
191
|
/**
|
|
169
|
-
* Guidance folded into the system prompt of every kind carrying this trait. A function
|
|
170
|
-
*
|
|
192
|
+
* Guidance folded into the system prompt of every kind carrying this trait. A function form
|
|
193
|
+
* receives the kind id plus what the dispatch delivered ({@link TraitDelivery}), and may return
|
|
194
|
+
* `undefined` to contribute NOTHING for this dispatch, which is what guidance naming an injected
|
|
195
|
+
* file does when the file is not there. Omit for a pure marker trait whose effect lives in the
|
|
171
196
|
* engine (like `code-aware`).
|
|
172
197
|
*/
|
|
173
|
-
guidance?: string | ((kind: AgentKind) => string);
|
|
198
|
+
guidance?: string | ((kind: AgentKind, delivery: TraitDelivery) => string | undefined);
|
|
174
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* The {@link TraitDelivery} for a resolved dispatch: what the engine put in front of THIS agent.
|
|
202
|
+
*
|
|
203
|
+
* One helper for all three prompt-composing surfaces (container dispatch, the inline executor, a
|
|
204
|
+
* consensus panel) rather than a `.map(f => f.path)` at each, because the three must agree: a
|
|
205
|
+
* surface that built the set differently would gate the same kind's guidance differently for no
|
|
206
|
+
* reason a reader could find. An absent `injectedContextFiles` yields an EMPTY list rather than an
|
|
207
|
+
* unknown one, and deliberately: the field is absent exactly when the dispatch injected nothing.
|
|
208
|
+
*/
|
|
209
|
+
export declare function traitDeliveryFor(context: {
|
|
210
|
+
injectedContextFiles?: readonly {
|
|
211
|
+
path: string;
|
|
212
|
+
}[];
|
|
213
|
+
}): TraitDelivery;
|
|
175
214
|
/**
|
|
176
215
|
* The standard trait DEFINITIONS, pre-loaded onto every {@link AgentKindRegistry} instance
|
|
177
216
|
* (its constructor installs them) — the analogue of `STANDARD_AGENT_TRAITS`, but for the
|
|
@@ -201,6 +240,10 @@ export declare function standardsVerbosityFor(kind: AgentKind, registry: AgentKi
|
|
|
201
240
|
* The guidance lines contributed by the traits a kind carries, in trait order. Folded
|
|
202
241
|
* into the kind's system prompt by `systemPromptFor`. Marker traits (no guidance, e.g.
|
|
203
242
|
* `code-aware`) contribute nothing here. Trait definitions are read off the injected registry.
|
|
243
|
+
*
|
|
244
|
+
* `delivery` is what the dispatch actually injected, so guidance that names a `.cat-context/` file
|
|
245
|
+
* can decline to say anything when the file is not there. Omitted, every trait renders in full:
|
|
246
|
+
* see {@link TraitDelivery} for why unknown is not the same as absent.
|
|
204
247
|
*/
|
|
205
|
-
export declare function traitGuidanceFor(kind: AgentKind, registry: AgentKindRegistry): string[];
|
|
248
|
+
export declare function traitGuidanceFor(kind: AgentKind, registry: AgentKindRegistry, delivery?: TraitDelivery): string[];
|
|
206
249
|
//# sourceMappingURL=traits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EASf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAetD,yFAAyF;AACzF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,UAAwB,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAA6B,CAAA;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAA4B,CAAA;AAE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAA6B,CAAA;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAA4B,CAAA;AAE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAA8B,CAAA;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,UAAmC,CAAA;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,UAAqC,CAAA;AAEhF,4FAA4F;AAC5F,eAAO,MAAM,6BAA6B,QAK9B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C,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,GAAG,CAAC,UAAU,CAAC,CAKvF;AAED,sCAAsC;AACtC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAEjG;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,iBAAiB,GAC1B,MAAM,GAAG,OAAO,CAElB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,GAAE,aAAkB,GAC3B,MAAM,EAAE,CASV"}
|
|
@@ -227,6 +227,27 @@ export const STANDARD_AGENT_TRAITS = {
|
|
|
227
227
|
[INITIATIVE_INTERVIEWER_AGENT_KIND]: [INTERVIEW_GATE_TRAIT],
|
|
228
228
|
[DOC_INTERVIEWER_AGENT_KIND]: [INTERVIEW_GATE_TRAIT],
|
|
229
229
|
};
|
|
230
|
+
/**
|
|
231
|
+
* Whether `path` was injected for this dispatch, treating an unknown delivery as delivered.
|
|
232
|
+
*
|
|
233
|
+
* The default is what keeps the change additive: every caller that cannot know (the editor, the
|
|
234
|
+
* sandbox, a unit test) composes exactly the prompt it composed before.
|
|
235
|
+
*/
|
|
236
|
+
function wasDelivered(delivery, path) {
|
|
237
|
+
return delivery.contextPaths === undefined || delivery.contextPaths.includes(path);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The {@link TraitDelivery} for a resolved dispatch: what the engine put in front of THIS agent.
|
|
241
|
+
*
|
|
242
|
+
* One helper for all three prompt-composing surfaces (container dispatch, the inline executor, a
|
|
243
|
+
* consensus panel) rather than a `.map(f => f.path)` at each, because the three must agree: a
|
|
244
|
+
* surface that built the set differently would gate the same kind's guidance differently for no
|
|
245
|
+
* reason a reader could find. An absent `injectedContextFiles` yields an EMPTY list rather than an
|
|
246
|
+
* unknown one, and deliberately: the field is absent exactly when the dispatch injected nothing.
|
|
247
|
+
*/
|
|
248
|
+
export function traitDeliveryFor(context) {
|
|
249
|
+
return { contextPaths: (context.injectedContextFiles ?? []).map((file) => file.path) };
|
|
250
|
+
}
|
|
230
251
|
/**
|
|
231
252
|
* The standard trait DEFINITIONS, pre-loaded onto every {@link AgentKindRegistry} instance
|
|
232
253
|
* (its constructor installs them) — the analogue of `STANDARD_AGENT_TRAITS`, but for the
|
|
@@ -243,8 +264,26 @@ export const STANDARD_TRAIT_DEFINITIONS = [
|
|
|
243
264
|
// A marker: the queued skills each render their own prompt section through the shared skill
|
|
244
265
|
// delivery, so there is nothing static to fold for a kind that carries it.
|
|
245
266
|
{ id: REVIEW_SKILLS_TRAIT },
|
|
246
|
-
|
|
247
|
-
|
|
267
|
+
// The two foundational traits are gated on their own file arriving. Each is a long section whose
|
|
268
|
+
// FIRST sentence points at a `.cat-context/` path, and the engine injects neither when no
|
|
269
|
+
// `FoundationalServiceResolver` is wired (`resolveFoundationalContext` returns nothing at all
|
|
270
|
+
// there) — so on such a deployment both were pure overhead pointing at nothing. Where a resolver
|
|
271
|
+
// IS wired the file is always written, empty catalog and failed read included, each SAYING which
|
|
272
|
+
// it is; those states are exactly what the guidance asks the agent to act on, so presence is the
|
|
273
|
+
// right condition and emptiness is not.
|
|
274
|
+
{
|
|
275
|
+
id: FOUNDATIONAL_CATALOG_TRAIT,
|
|
276
|
+
guidance: (_kind, delivery) => wasDelivered(delivery, FOUNDATIONAL_CATALOG_FILE) ? FOUNDATIONAL_CATALOG_GUIDANCE : undefined,
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: FOUNDATIONAL_CONTRACTS_TRAIT,
|
|
280
|
+
guidance: (_kind, delivery) => wasDelivered(delivery, FOUNDATIONAL_INDEX_FILE) ? FOUNDATIONAL_CONTRACTS_GUIDANCE : undefined,
|
|
281
|
+
},
|
|
282
|
+
// NOT gated, deliberately, though it names a file the same way. Its own text handles the absent
|
|
283
|
+
// case as a REFUSAL ("If that file is absent, the platform could not provide storage — do not
|
|
284
|
+
// attempt any upload; state it in your report and stop generating"), which is a thing the agent
|
|
285
|
+
// must be told rather than a pointer to drop: gated off, a binary-generating kind with no
|
|
286
|
+
// storage would generate happily and deliver nowhere.
|
|
248
287
|
{ id: BINARY_OUTPUT_TRAIT, guidance: BINARY_OUTPUT_GUIDANCE },
|
|
249
288
|
// A marker: the pictures are delivered as context (files or attached parts) and the prompt
|
|
250
289
|
// section that names them is rendered from what the dispatch actually achieved, so there is no
|
|
@@ -284,14 +323,20 @@ export function standardsVerbosityFor(kind, registry) {
|
|
|
284
323
|
* The guidance lines contributed by the traits a kind carries, in trait order. Folded
|
|
285
324
|
* into the kind's system prompt by `systemPromptFor`. Marker traits (no guidance, e.g.
|
|
286
325
|
* `code-aware`) contribute nothing here. Trait definitions are read off the injected registry.
|
|
326
|
+
*
|
|
327
|
+
* `delivery` is what the dispatch actually injected, so guidance that names a `.cat-context/` file
|
|
328
|
+
* can decline to say anything when the file is not there. Omitted, every trait renders in full:
|
|
329
|
+
* see {@link TraitDelivery} for why unknown is not the same as absent.
|
|
287
330
|
*/
|
|
288
|
-
export function traitGuidanceFor(kind, registry) {
|
|
331
|
+
export function traitGuidanceFor(kind, registry, delivery = {}) {
|
|
289
332
|
const lines = [];
|
|
290
333
|
for (const trait of traitsFor(kind, registry)) {
|
|
291
334
|
const guidance = registry.traitDefinition(trait)?.guidance;
|
|
292
335
|
if (!guidance)
|
|
293
336
|
continue;
|
|
294
|
-
|
|
337
|
+
const rendered = typeof guidance === 'function' ? guidance(kind, delivery) : guidance;
|
|
338
|
+
if (rendered)
|
|
339
|
+
lines.push(rendered);
|
|
295
340
|
}
|
|
296
341
|
return lines;
|
|
297
342
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.js","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings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AC,GAAG,CAAC,KAAK,CAAC,CAAA;IACvE,OAAO,MAAM,CAAA;AACf,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,QAAQ,CAAC,IAAe,EAAE,KAAiB,EAAE,QAA2B;IACtF,OAAO,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AAC7C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAe,EACf,QAA2B;IAE3B,OAAO,QAAQ,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAA;AAC3E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAe,EACf,QAA2B,EAC3B,QAAQ,GAAkB,EAAE;IAE5B,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAA;QAC1D,IAAI,CAAC,QAAQ;YAAE,SAAQ;QACvB,MAAM,QAAQ,GAAG,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;QACrF,IAAI,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACpC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentKind } from '@cat-factory/kernel';
|
|
2
2
|
import type { AgentKindRegistry } from '../kinds/registry.js';
|
|
3
|
+
import type { TraitDelivery } from '../kinds/traits.js';
|
|
3
4
|
import { type BespokeSystemPrompt } from './bespoke.js';
|
|
4
5
|
/**
|
|
5
6
|
* The EDITABLE half of the `merger` prompt: what the agent is for. Replaced wholesale by a
|
|
@@ -86,6 +87,12 @@ export declare function shippedBasePromptFor(kind: AgentKind, registry: AgentKin
|
|
|
86
87
|
* alone is the bug it replaces: for the inline ENGINE kinds that returns the thin `roles.ts` line
|
|
87
88
|
* plus a second copy of directives the base already carried, so a candidate was graded on a prompt
|
|
88
89
|
* no run ever sends and could not be promoted unchanged.
|
|
90
|
+
*
|
|
91
|
+
* `delivery` is forwarded so trait guidance naming an injected `.cat-context/` file can stay silent
|
|
92
|
+
* when the dispatch did not inject it. A bespoke kind carries no trait guidance (its directives are
|
|
93
|
+
* a declared constant), so it ignores the argument rather than pretending to honour it. The Sandbox
|
|
94
|
+
* passes none: a graded candidate is composed against the maximal prompt, which is the honest thing
|
|
95
|
+
* to grade against and matches what the prompt editor shows.
|
|
89
96
|
*/
|
|
90
|
-
export declare function composedSystemPromptFor(kind: AgentKind, registry: AgentKindRegistry, replacement?: string): string;
|
|
97
|
+
export declare function composedSystemPromptFor(kind: AgentKind, registry: AgentKindRegistry, replacement?: string, delivery?: TraitDelivery): string;
|
|
91
98
|
//# sourceMappingURL=bespoke-kinds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bespoke-kinds.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/bespoke-kinds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"bespoke-kinds.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/bespoke-kinds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAyB7E;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAMmC,CAAA;AAElE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,QAIP,CAAA;AAEvB,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,QAAyC,CAAA;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAKsC,CAAA;AAEtE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAMR,CAAA;AAEvB,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,QAA2C,CAAA;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAiBlF,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAEzF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,aAAa,GACvB,MAAM,CAIR"}
|
|
@@ -143,11 +143,17 @@ export function shippedBasePromptFor(kind, registry) {
|
|
|
143
143
|
* alone is the bug it replaces: for the inline ENGINE kinds that returns the thin `roles.ts` line
|
|
144
144
|
* plus a second copy of directives the base already carried, so a candidate was graded on a prompt
|
|
145
145
|
* no run ever sends and could not be promoted unchanged.
|
|
146
|
+
*
|
|
147
|
+
* `delivery` is forwarded so trait guidance naming an injected `.cat-context/` file can stay silent
|
|
148
|
+
* when the dispatch did not inject it. A bespoke kind carries no trait guidance (its directives are
|
|
149
|
+
* a declared constant), so it ignores the argument rather than pretending to honour it. The Sandbox
|
|
150
|
+
* passes none: a graded candidate is composed against the maximal prompt, which is the honest thing
|
|
151
|
+
* to grade against and matches what the prompt editor shows.
|
|
146
152
|
*/
|
|
147
|
-
export function composedSystemPromptFor(kind, registry, replacement) {
|
|
153
|
+
export function composedSystemPromptFor(kind, registry, replacement, delivery) {
|
|
148
154
|
const bespoke = BESPOKE_SYSTEM_PROMPTS[kind];
|
|
149
155
|
if (bespoke)
|
|
150
156
|
return composeBespokePrompt(bespoke, replacement);
|
|
151
|
-
return systemPromptFor(kind, registry, replacement);
|
|
157
|
+
return systemPromptFor(kind, registry, replacement, delivery);
|
|
152
158
|
}
|
|
153
159
|
//# sourceMappingURL=bespoke-kinds.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bespoke-kinds.js","sourceRoot":"","sources":["../../../src/agents/prompts/bespoke-kinds.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bespoke-kinds.js","sourceRoot":"","sources":["../../../src/agents/prompts/bespoke-kinds.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,oBAAoB,EAA4B,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEnD,+FAA+F;AAC/F,kFAAkF;AAClF,EAAE;AACF,0FAA0F;AAC1F,gGAAgG;AAChG,kFAAkF;AAClF,iGAAiG;AACjG,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,wFAAwF;AACxF,uCAAuC;AACvC,EAAE;AACF,gGAAgG;AAChG,iGAAiG;AACjG,8FAA8F;AAC9F,gGAAgG;AAChG,+FAA+F;AAC/F,0DAA0D;AAE1D;;;GAGG;A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AUG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,QAA2B;IAC/E,OAAO,sBAAsB,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAClF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAe,EACf,QAA2B,EAC3B,WAAoB,EACpB,QAAwB;IAExB,MAAM,OAAO,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;IAC5C,IAAI,OAAO;QAAE,OAAO,oBAAoB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;IAC9D,OAAO,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAA;AAC/D,CAAC"}
|
|
@@ -29,6 +29,33 @@ export declare function mergerUserPrompt(context: AgentRunContext, dispatch?: Ag
|
|
|
29
29
|
* generic prompt is what makes this a regression investigation rather than a code read.
|
|
30
30
|
*/
|
|
31
31
|
export declare function onCallUserPromptSuffix(context: AgentRunContext, dispatch?: AgentDispatchContext): string;
|
|
32
|
+
/**
|
|
33
|
+
* The `task-reassessor`'s task prompt: read the change the run actually landed and score the
|
|
34
|
+
* three triage axes against it.
|
|
35
|
+
*
|
|
36
|
+
* The checkout is the pr-reviewer's: the BASE branch plus the pull request's head fetched as
|
|
37
|
+
* `origin/pr-head` by the harness. That shape rather than a clone of the PR branch because the
|
|
38
|
+
* branch is DELETED once the pull request merges, while `refs/pull/<n>/head` survives it, so the
|
|
39
|
+
* same step reads the same diff whether it runs before the merge or after it. The pull request it
|
|
40
|
+
* names is the one the harness fetched: the kind declares `prHeadSource: 'run'`, so that is
|
|
41
|
+
* `block.pullRequest` and not a PR the task might separately name.
|
|
42
|
+
*
|
|
43
|
+
* A REPLACEMENT prompt rather than a `userPromptSuffix`, and the two things that costs are both
|
|
44
|
+
* deliberate. What it drops is the fold of every prior step's output, which on this pipeline
|
|
45
|
+
* position CONTAINS THE FORECAST: the estimator's own step output is `summarizeEstimate`, in
|
|
46
|
+
* percentages. This kind must not see it (an assessment handed the number it is revising anchors
|
|
47
|
+
* on it, and the delta is arithmetic the platform does from the two records), so the fold is the
|
|
48
|
+
* thing being withheld rather than a casualty of withholding it. What it must NOT drop is the
|
|
49
|
+
* account of what the work was: the task's description and, above all, the system it belongs to,
|
|
50
|
+
* both re-stated below, because the impact axis is a blast radius and a bare title names no
|
|
51
|
+
* software for one to be judged against.
|
|
52
|
+
*
|
|
53
|
+
* A MULTI-REPO task is named rather than silently under-scored. The peer PRs' repositories are not
|
|
54
|
+
* in this checkout (resolving them is the merger's combined-diff path, which is that kind's alone),
|
|
55
|
+
* so the assessment covers the primary repository's change and has to SAY so, or a reader takes a
|
|
56
|
+
* partial score for the whole one.
|
|
57
|
+
*/
|
|
58
|
+
export declare function taskReassessorUserPrompt(context: AgentRunContext, dispatch?: AgentDispatchContext): string;
|
|
32
59
|
/**
|
|
33
60
|
* The conflict-resolver's task prompt: a COMPACT task reference, deliberately NOT the generic
|
|
34
61
|
* block-context prompt.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-in-container.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/built-in-container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"built-in-container.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/built-in-container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAqBhF,6FAA6F;AAC7F,eAAO,MAAM,2BAA2B,QAEQ,CAAA;AAEhD,8FAA8F;AAC9F,eAAO,MAAM,6BAA6B,QAEgC,CAAA;AAE1E,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,QAGkE,CAAA;AAErG,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,QAGiD,CAAA;AAMvF;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,MAAM,CAqBR;AAkBD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,MAAM,CAwBR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,MAAM,CAwCR;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAG3E"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TRIAGE_JSON_CONTRACT } from './roles.js';
|
|
2
|
+
import { ownServiceSection } from './standard.js';
|
|
1
3
|
// ---------------------------------------------------------------------------
|
|
2
4
|
// The task prompts + structured-output shape hints for the BUILT-IN container kinds that assess
|
|
3
5
|
// rather than produce (`merger`, `on-call`) and for the tester family's reply shape.
|
|
@@ -113,6 +115,72 @@ export function onCallUserPromptSuffix(context, dispatch) {
|
|
|
113
115
|
'Respond with ONLY a JSON object {"culpritConfidence":0.0,"recommendation":"revert"|"hold"|"monitor","rationale":"…","evidence":["…"]}.',
|
|
114
116
|
].join('\n');
|
|
115
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* The `task-reassessor`'s task prompt: read the change the run actually landed and score the
|
|
120
|
+
* three triage axes against it.
|
|
121
|
+
*
|
|
122
|
+
* The checkout is the pr-reviewer's: the BASE branch plus the pull request's head fetched as
|
|
123
|
+
* `origin/pr-head` by the harness. That shape rather than a clone of the PR branch because the
|
|
124
|
+
* branch is DELETED once the pull request merges, while `refs/pull/<n>/head` survives it, so the
|
|
125
|
+
* same step reads the same diff whether it runs before the merge or after it. The pull request it
|
|
126
|
+
* names is the one the harness fetched: the kind declares `prHeadSource: 'run'`, so that is
|
|
127
|
+
* `block.pullRequest` and not a PR the task might separately name.
|
|
128
|
+
*
|
|
129
|
+
* A REPLACEMENT prompt rather than a `userPromptSuffix`, and the two things that costs are both
|
|
130
|
+
* deliberate. What it drops is the fold of every prior step's output, which on this pipeline
|
|
131
|
+
* position CONTAINS THE FORECAST: the estimator's own step output is `summarizeEstimate`, in
|
|
132
|
+
* percentages. This kind must not see it (an assessment handed the number it is revising anchors
|
|
133
|
+
* on it, and the delta is arithmetic the platform does from the two records), so the fold is the
|
|
134
|
+
* thing being withheld rather than a casualty of withholding it. What it must NOT drop is the
|
|
135
|
+
* account of what the work was: the task's description and, above all, the system it belongs to,
|
|
136
|
+
* both re-stated below, because the impact axis is a blast radius and a bare title names no
|
|
137
|
+
* software for one to be judged against.
|
|
138
|
+
*
|
|
139
|
+
* A MULTI-REPO task is named rather than silently under-scored. The peer PRs' repositories are not
|
|
140
|
+
* in this checkout (resolving them is the merger's combined-diff path, which is that kind's alone),
|
|
141
|
+
* so the assessment covers the primary repository's change and has to SAY so, or a reader takes a
|
|
142
|
+
* partial score for the whole one.
|
|
143
|
+
*/
|
|
144
|
+
export function taskReassessorUserPrompt(context, dispatch) {
|
|
145
|
+
const prNumber = context.block.pullRequest?.number;
|
|
146
|
+
const pr = prNumber !== undefined ? ` (PR #${prNumber})` : '';
|
|
147
|
+
// With no dispatch context there is no checkout and therefore no branch to name: say what to
|
|
148
|
+
// read without asserting a branch name the caller never resolved.
|
|
149
|
+
const readGuidance = dispatch
|
|
150
|
+
? `You are on the base branch \`${dispatch.baseBranch}\`, and the change${pr} has been ` +
|
|
151
|
+
'fetched for you as `origin/pr-head`:\n' +
|
|
152
|
+
` git diff --name-status origin/${dispatch.baseBranch}...origin/pr-head # the shape of the change\n` +
|
|
153
|
+
` git diff origin/${dispatch.baseBranch}...origin/pr-head -- <path> # one file's diff\n` +
|
|
154
|
+
'Start from the shape, then read the diffs that decide the score. If `origin/pr-head` is ' +
|
|
155
|
+
'absent (the fetch was skipped), say so in your rationale and score from the evidence above ' +
|
|
156
|
+
'rather than guessing.'
|
|
157
|
+
: `Score the change${pr} from the evidence you have been given.`;
|
|
158
|
+
const peers = context.block.peerPullRequests?.length ?? 0;
|
|
159
|
+
const scope = peers > 0
|
|
160
|
+
? `This task also changed ${peers} connected service repositor${peers === 1 ? 'y' : 'ies'}, ` +
|
|
161
|
+
'which are NOT in this checkout. Score the change you can read, and state in your ' +
|
|
162
|
+
'rationale that the connected repositories were out of scope.'
|
|
163
|
+
: null;
|
|
164
|
+
const description = context.block.description?.trim();
|
|
165
|
+
// The system the work belongs to, or the explicit statement that nothing named one. Rendered
|
|
166
|
+
// rather than omitted for the reason `ownServiceSection` exists: the impact axis is a blast
|
|
167
|
+
// radius, and a model given no system to judge one against supplies one. Trimmed because the
|
|
168
|
+
// shared helper leads with its own blank lines for the generic prompt's line list.
|
|
169
|
+
const ownService = ownServiceSection(context).trim();
|
|
170
|
+
return [
|
|
171
|
+
'The implementation for this task has landed. Assess what was ACTUALLY built and return the ' +
|
|
172
|
+
'complexity / risk / impact scores + rationale as JSON.',
|
|
173
|
+
'',
|
|
174
|
+
readGuidance,
|
|
175
|
+
...(scope ? ['', scope] : []),
|
|
176
|
+
'',
|
|
177
|
+
`Task: ${context.block.title}`,
|
|
178
|
+
...(description ? ['', description] : []),
|
|
179
|
+
...(ownService ? ['', ownService] : []),
|
|
180
|
+
'',
|
|
181
|
+
TRIAGE_JSON_CONTRACT,
|
|
182
|
+
].join('\n');
|
|
183
|
+
}
|
|
116
184
|
/**
|
|
117
185
|
* The conflict-resolver's task prompt: a COMPACT task reference, deliberately NOT the generic
|
|
118
186
|
* block-context prompt.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-in-container.js","sourceRoot":"","sources":["../../../src/agents/prompts/built-in-container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"built-in-container.js","sour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AAC,CAAC,CAAC,KAAK,IAAI;YAC3F,mFAAmF;YACnF,8DAA8D;QAChE,CAAC,CAAC,IAAI,CAAA;IACV,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,CAAA;IACrD,6FAA6F;IAC7F,4FAA4F;IAC5F,6FAA6F;IAC7F,mFAAmF;IACnF,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;IACpD,OAAO;QACL,6FAA6F;YAC3F,wDAAwD;QAC1D,EAAE;QACF,YAAY;QACZ,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,EAAE;QACF,SAAS,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE;QAC9B,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,EAAE;QACF,oBAAoB;KACrB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAwB;IACjE,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,CAAA;IACrD,OAAO,SAAS,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,OAAO,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;AACjF,CAAC"}
|
|
@@ -1,5 +1,43 @@
|
|
|
1
|
-
import type { AgentKind } from '@cat-factory/kernel';
|
|
1
|
+
import type { AgentDispatchContext, AgentKind, AgentRunContext } from '@cat-factory/kernel';
|
|
2
2
|
import type { AgentKindRegistry } from '../kinds/registry.js';
|
|
3
3
|
/** The companion system prompt for `kind`, or undefined when `kind` is not a companion. */
|
|
4
4
|
export declare function companionSystemPrompt(kind: AgentKind, registry: AgentKindRegistry): string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Where a container-backed companion's review STARTS: the refs its checkout actually has, the two
|
|
7
|
+
* commands that turn them into the change, and the rule that it plans from the shape before it
|
|
8
|
+
* reads anything.
|
|
9
|
+
*
|
|
10
|
+
* The `pr-reviewer` has had this since it shipped, as an injected `.cat-context/pr-diff.md` its
|
|
11
|
+
* prompt tells it to read first; the container-backed companions had nothing equivalent and were
|
|
12
|
+
* told only to "diff against the base branch", which they had to first work out the name of. What
|
|
13
|
+
* this states instead is what the DISPATCH resolved, which is the one thing the agent cannot
|
|
14
|
+
* derive: `AgentDispatchContext.baseBranch` is the branch the engine forked from, and it is a
|
|
15
|
+
* per-deployment fact (`main`, `master`, `develop`, a release line).
|
|
16
|
+
*
|
|
17
|
+
* A SECTION rather than an injected file, deliberately: a `.cat-context/pr-diff.md` would mean a
|
|
18
|
+
* preOp reading the change back over HTTP to write bytes the checkout already has, and would
|
|
19
|
+
* duplicate the diff into a prompt that is re-sent on every turn. The commands cost the reviewer
|
|
20
|
+
* two turns and the output lands only in the turns that need it.
|
|
21
|
+
*
|
|
22
|
+
* No `git fetch` is named, and that is the point: the container agent holds NO git credential of
|
|
23
|
+
* its own (the token lives with the harness and rides GIT_ASKPASS per harness-issued command), so
|
|
24
|
+
* an agent-issued fetch fails outright on a private repo. The refs are the harness's job — a
|
|
25
|
+
* companion dispatch clones with full history, which brings `origin/<base>` with it, and the
|
|
26
|
+
* warm-pool path refreshes it (`exploreCheckoutRefs`). Naming a command the agent cannot run would
|
|
27
|
+
* put an error on the very first instruction the review is anchored on.
|
|
28
|
+
*
|
|
29
|
+
* Returns `undefined` when there is no change to measure, which is every case the commands would
|
|
30
|
+
* lie about:
|
|
31
|
+
* - a non-companion kind, or an INLINE companion (no checkout at all, so naming git commands
|
|
32
|
+
* would be the exact "things that are not true of this run" failure);
|
|
33
|
+
* - no resolved dispatch (a consensus panel participant: no filesystem, no tools);
|
|
34
|
+
* - a checkout that IS the base branch. A `clone.branch: 'pr'` dispatch falls back to base when
|
|
35
|
+
* the producer opened no pull request, and there `<base>...HEAD` is empty: the reviewer would
|
|
36
|
+
* be told to plan from a diffstat showing nothing and not to go looking past it, and would
|
|
37
|
+
* grade an empty change as the work;
|
|
38
|
+
* - a base branch whose name cannot be safely quoted, which is REPORTED rather than silently
|
|
39
|
+
* shortened: the section states the branch it could not name and stops, leaving the system
|
|
40
|
+
* prompt's own "start from what actually changed" instruction to stand.
|
|
41
|
+
*/
|
|
42
|
+
export declare function companionCheckoutSection(context: AgentRunContext, registry: AgentKindRegistry, dispatch?: AgentDispatchContext): string | undefined;
|
|
5
43
|
//# sourceMappingURL=companion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/companion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"companion.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/companion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAc7D,2FAA2F;AAC3F,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,iBAAiB,GAC1B,MAAM,GAAG,SAAS,CAiIpB;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,MAAM,GAAG,SAAS,CAkCpB"}
|
|
@@ -24,19 +24,32 @@ export function companionSystemPrompt(kind, registry) {
|
|
|
24
24
|
// rework loop's scores wander instead of climb: the step's `threshold` can only mean
|
|
25
25
|
// something if two consecutive rounds mean the same thing by 0.8.
|
|
26
26
|
anchoredQualityScale('the standard for this deliverable'),
|
|
27
|
+
// The numeric bar is deliberately NOT named here, nor pointed at. It is a per-STEP operator
|
|
28
|
+
// setting that `withGradingBar` states with the work, and that wrapper is absent on every
|
|
29
|
+
// surface with no live companion loop to read one off — the prompt editor, the Sandbox
|
|
30
|
+
// composing a graded candidate, a dispatch whose step carries no companion state. A sentence
|
|
31
|
+
// here promising the number "below" is a dangling pointer on exactly those surfaces, which is
|
|
32
|
+
// the same defect this prompt's own trait guidance is gated to avoid. The scale's anchors are
|
|
33
|
+
// self-contained without it.
|
|
34
|
+
//
|
|
27
35
|
// A container-backed companion gets a real, read-only checkout of the producer's PR
|
|
28
36
|
// branch. Reviewing the producer's summary reply alone is worthless — judge the ACTUAL
|
|
29
37
|
// artifact: open and read the changed files / the full committed document and whatever
|
|
30
38
|
// surrounding repository context you need to assess it properly. The preceding step's
|
|
31
39
|
// reply (if any) is only a pointer; the repository on disk is the source of truth.
|
|
40
|
+
//
|
|
41
|
+
// It names no commands and points at none, for the same reason: `companionCheckoutSection`
|
|
42
|
+
// WITHHOLDS them wherever they would describe a checkout that is not a change (a dispatch that
|
|
43
|
+
// fell back to the base branch, a base ref that cannot be safely quoted). This instruction has
|
|
44
|
+
// to stand on its own in those runs, so it states the rule rather than deferring to a section.
|
|
32
45
|
...(isContainerBackedCompanion(kind, registry)
|
|
33
46
|
? [
|
|
34
47
|
'',
|
|
35
|
-
'You have a read-only checkout of the branch under review
|
|
36
|
-
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
48
|
+
'You have a read-only checkout of the branch under review, with full history.',
|
|
49
|
+
'Do NOT judge from the summary alone: start from what actually changed, then open and',
|
|
50
|
+
'read the changed files in full, plus any related code or documents in the repository',
|
|
51
|
+
'you need for context, before rating. Ground every comment in what the files actually',
|
|
52
|
+
'contain. Make no commits.',
|
|
40
53
|
]
|
|
41
54
|
: []),
|
|
42
55
|
// The document reviewer carries `doc-aware`, so the engine folds the task's
|
|
@@ -125,4 +138,86 @@ export function companionSystemPrompt(kind, registry) {
|
|
|
125
138
|
FINAL_ANSWER_IN_REPLY,
|
|
126
139
|
].join('\n');
|
|
127
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* A branch name safe to interpolate into a shell command and a markdown code span.
|
|
143
|
+
*
|
|
144
|
+
* The base branch is PROVIDER-supplied, and git permits far more in a ref than a shell does: a
|
|
145
|
+
* backtick closes the code span and reflows the rest of this section as prose, and `$(…)` in a
|
|
146
|
+
* command the agent is told to run is a substitution the agent's own shell tool performs. Model-
|
|
147
|
+
* and provider-authored strings that become git arguments are validated for MAGIC rather than
|
|
148
|
+
* merely for traversal, so this is an ALLOW-list of what a ref may contain, not a deny-list of
|
|
149
|
+
* what bites. Leading `-` is excluded separately: it turns the name into an option.
|
|
150
|
+
*/
|
|
151
|
+
const SAFE_BRANCH_NAME = /^[A-Za-z0-9._/][A-Za-z0-9._/-]*$/;
|
|
152
|
+
/**
|
|
153
|
+
* Where a container-backed companion's review STARTS: the refs its checkout actually has, the two
|
|
154
|
+
* commands that turn them into the change, and the rule that it plans from the shape before it
|
|
155
|
+
* reads anything.
|
|
156
|
+
*
|
|
157
|
+
* The `pr-reviewer` has had this since it shipped, as an injected `.cat-context/pr-diff.md` its
|
|
158
|
+
* prompt tells it to read first; the container-backed companions had nothing equivalent and were
|
|
159
|
+
* told only to "diff against the base branch", which they had to first work out the name of. What
|
|
160
|
+
* this states instead is what the DISPATCH resolved, which is the one thing the agent cannot
|
|
161
|
+
* derive: `AgentDispatchContext.baseBranch` is the branch the engine forked from, and it is a
|
|
162
|
+
* per-deployment fact (`main`, `master`, `develop`, a release line).
|
|
163
|
+
*
|
|
164
|
+
* A SECTION rather than an injected file, deliberately: a `.cat-context/pr-diff.md` would mean a
|
|
165
|
+
* preOp reading the change back over HTTP to write bytes the checkout already has, and would
|
|
166
|
+
* duplicate the diff into a prompt that is re-sent on every turn. The commands cost the reviewer
|
|
167
|
+
* two turns and the output lands only in the turns that need it.
|
|
168
|
+
*
|
|
169
|
+
* No `git fetch` is named, and that is the point: the container agent holds NO git credential of
|
|
170
|
+
* its own (the token lives with the harness and rides GIT_ASKPASS per harness-issued command), so
|
|
171
|
+
* an agent-issued fetch fails outright on a private repo. The refs are the harness's job — a
|
|
172
|
+
* companion dispatch clones with full history, which brings `origin/<base>` with it, and the
|
|
173
|
+
* warm-pool path refreshes it (`exploreCheckoutRefs`). Naming a command the agent cannot run would
|
|
174
|
+
* put an error on the very first instruction the review is anchored on.
|
|
175
|
+
*
|
|
176
|
+
* Returns `undefined` when there is no change to measure, which is every case the commands would
|
|
177
|
+
* lie about:
|
|
178
|
+
* - a non-companion kind, or an INLINE companion (no checkout at all, so naming git commands
|
|
179
|
+
* would be the exact "things that are not true of this run" failure);
|
|
180
|
+
* - no resolved dispatch (a consensus panel participant: no filesystem, no tools);
|
|
181
|
+
* - a checkout that IS the base branch. A `clone.branch: 'pr'` dispatch falls back to base when
|
|
182
|
+
* the producer opened no pull request, and there `<base>...HEAD` is empty: the reviewer would
|
|
183
|
+
* be told to plan from a diffstat showing nothing and not to go looking past it, and would
|
|
184
|
+
* grade an empty change as the work;
|
|
185
|
+
* - a base branch whose name cannot be safely quoted, which is REPORTED rather than silently
|
|
186
|
+
* shortened: the section states the branch it could not name and stops, leaving the system
|
|
187
|
+
* prompt's own "start from what actually changed" instruction to stand.
|
|
188
|
+
*/
|
|
189
|
+
export function companionCheckoutSection(context, registry, dispatch) {
|
|
190
|
+
if (!dispatch || !isContainerBackedCompanion(context.agentKind, registry))
|
|
191
|
+
return undefined;
|
|
192
|
+
const base = dispatch.baseBranch;
|
|
193
|
+
if (dispatch.checkoutBranch === base)
|
|
194
|
+
return undefined;
|
|
195
|
+
if (!SAFE_BRANCH_NAME.test(base)) {
|
|
196
|
+
return ('\nThis checkout is a change measured against the repository base branch. Its name contains ' +
|
|
197
|
+
'characters this prompt cannot safely quote, so the diff commands are omitted here: derive ' +
|
|
198
|
+
'the base ref yourself (`git branch -r`) before reading anything, and say in your summary ' +
|
|
199
|
+
'that you had to.');
|
|
200
|
+
}
|
|
201
|
+
const lines = [
|
|
202
|
+
'',
|
|
203
|
+
`The change under review is this checkout measured against \`${base}\`, the base branch it ` +
|
|
204
|
+
'forked from. Establish the shape before you read anything:',
|
|
205
|
+
`- \`git diff --stat origin/${base}...HEAD\` for which files moved and by how much.`,
|
|
206
|
+
`- \`git diff origin/${base}...HEAD -- <path>\` for the change to a file or a directory.`,
|
|
207
|
+
'Plan the review from that diffstat: it already tells you which files this change is about, so ' +
|
|
208
|
+
'do not go looking for them. Read a changed file in full where the diff alone cannot settle ' +
|
|
209
|
+
'whether it is correct, and read unchanged code where you need it for context.',
|
|
210
|
+
];
|
|
211
|
+
if (dispatch.multiRepo) {
|
|
212
|
+
lines.push(
|
|
213
|
+
// What is true of a peer leg and no more. An explore peer carries `cloneBranch` only when the
|
|
214
|
+
// caller pinned one (today only the merger's combined-diff builder does), so a peer is
|
|
215
|
+
// otherwise checked out at its OWN default branch: claiming they share this branch would send
|
|
216
|
+
// the reviewer to run a diff that resolves to nothing and read the emptiness as a verdict.
|
|
217
|
+
'This change spans MULTIPLE repositories, each checked out as a sibling directory. Establish ' +
|
|
218
|
+
"each one's own base the same way before you read it, and rate the COMBINED change as a " +
|
|
219
|
+
'single verdict, not one per repository.');
|
|
220
|
+
}
|
|
221
|
+
return lines.join('\n');
|
|
222
|
+
}
|
|
128
223
|
//# sourceMappingURL=companion.js.map
|