@cat-factory/agents 0.94.0 → 0.96.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.
Files changed (45) hide show
  1. package/dist/agents/kinds/registry.d.ts +25 -0
  2. package/dist/agents/kinds/registry.d.ts.map +1 -1
  3. package/dist/agents/kinds/registry.js +39 -0
  4. package/dist/agents/kinds/registry.js.map +1 -1
  5. package/dist/agents/kinds/traits.d.ts +22 -0
  6. package/dist/agents/kinds/traits.d.ts.map +1 -1
  7. package/dist/agents/kinds/traits.js +42 -3
  8. package/dist/agents/kinds/traits.js.map +1 -1
  9. package/dist/agents/kinds/variants.d.ts +115 -0
  10. package/dist/agents/kinds/variants.d.ts.map +1 -0
  11. package/dist/agents/kinds/variants.js +35 -0
  12. package/dist/agents/kinds/variants.js.map +1 -0
  13. package/dist/agents/prompts/bespoke-kinds.d.ts +72 -0
  14. package/dist/agents/prompts/bespoke-kinds.d.ts.map +1 -0
  15. package/dist/agents/prompts/bespoke-kinds.js +114 -0
  16. package/dist/agents/prompts/bespoke-kinds.js.map +1 -0
  17. package/dist/foundationalServices/FoundationalServiceCatalogService.d.ts +65 -0
  18. package/dist/foundationalServices/FoundationalServiceCatalogService.d.ts.map +1 -0
  19. package/dist/foundationalServices/FoundationalServiceCatalogService.js +284 -0
  20. package/dist/foundationalServices/FoundationalServiceCatalogService.js.map +1 -0
  21. package/dist/foundationalServices/FoundationalServiceRunResolver.d.ts +37 -0
  22. package/dist/foundationalServices/FoundationalServiceRunResolver.d.ts.map +1 -0
  23. package/dist/foundationalServices/FoundationalServiceRunResolver.js +92 -0
  24. package/dist/foundationalServices/FoundationalServiceRunResolver.js.map +1 -0
  25. package/dist/foundationalServices/FoundationalServiceSourceService.d.ts +86 -0
  26. package/dist/foundationalServices/FoundationalServiceSourceService.d.ts.map +1 -0
  27. package/dist/foundationalServices/FoundationalServiceSourceService.js +346 -0
  28. package/dist/foundationalServices/FoundationalServiceSourceService.js.map +1 -0
  29. package/dist/foundationalServices/contract-validation.d.ts +8 -0
  30. package/dist/foundationalServices/contract-validation.d.ts.map +1 -0
  31. package/dist/foundationalServices/contract-validation.js +43 -0
  32. package/dist/foundationalServices/contract-validation.js.map +1 -0
  33. package/dist/foundationalServices/foundational-catalog.d.ts +22 -0
  34. package/dist/foundationalServices/foundational-catalog.d.ts.map +1 -0
  35. package/dist/foundationalServices/foundational-catalog.js +58 -0
  36. package/dist/foundationalServices/foundational-catalog.js.map +1 -0
  37. package/dist/foundationalServices/foundational-source.logic.d.ts +51 -0
  38. package/dist/foundationalServices/foundational-source.logic.d.ts.map +1 -0
  39. package/dist/foundationalServices/foundational-source.logic.js +109 -0
  40. package/dist/foundationalServices/foundational-source.logic.js.map +1 -0
  41. package/dist/index.d.ts +9 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +15 -1
  44. package/dist/index.js.map +1 -1
  45. package/package.json +5 -5
@@ -4,6 +4,7 @@ import { normalizeSkillRefs, normalizeToolRefs } from './capabilities.js';
4
4
  import type { AgentPresentation } from '@cat-factory/contracts';
5
5
  import type { AgentTrait, AgentTraitDefinition } from './traits.js';
6
6
  import type { AgentTuning } from './tuning.js';
7
+ import type { AgentKindVariantDefinition } from './variants.js';
7
8
  import type { StructuredOutput } from './structured-output.js';
8
9
  export interface AgentKindDefinition {
9
10
  /** The free-form agent-kind id used in pipelines and steps (e.g. `security-auditor`). */
@@ -178,6 +179,7 @@ export declare class AgentKindRegistry {
178
179
  private readonly toolServerDefinitions;
179
180
  private readonly assignedSkills;
180
181
  private readonly assignedToolServers;
182
+ private readonly variantDefinitions;
181
183
  constructor();
182
184
  /** Register a custom agent kind. A later registration of the same id replaces the earlier one. */
183
185
  register(definition: AgentKindDefinition): void;
@@ -295,6 +297,29 @@ export declare class AgentKindRegistry {
295
297
  * not thrown on (see {@link skillsFor}).
296
298
  */
297
299
  toolServersFor(kind: AgentKind): ReturnType<typeof normalizeToolRefs>;
300
+ /**
301
+ * Register a VARIATION of an existing agent kind — an alternate prompt a pipeline step selects
302
+ * by id, running the base kind in every other respect. A later registration of the same id
303
+ * replaces the earlier one, which is also how a deployment RE-WORDS a variant an installed
304
+ * package shipped without forking it — safe for Kaizen because a step is keyed by a fingerprint
305
+ * of the text its variant contributed, not by the id alone (see `AppliedAgentVariant`).
306
+ *
307
+ * Nothing is validated here (an id may legitimately be registered before its base kind is):
308
+ * `validateRegistrations` reports an unknown base, a collision with a kind id, and a variant
309
+ * that changes no text, as startup errors.
310
+ */
311
+ registerVariant(definition: AgentKindVariantDefinition): void;
312
+ /** Register several variants at once. */
313
+ registerVariants(definitions: Iterable<AgentKindVariantDefinition>): void;
314
+ /** A registered variant, or undefined when the id is unknown. */
315
+ variant(id: string): AgentKindVariantDefinition | undefined;
316
+ /** All registered variants (registration order). */
317
+ variants(): AgentKindVariantDefinition[];
318
+ /**
319
+ * The variants registered for one kind — what the pipeline builder offers on a step of that
320
+ * kind. Empty when the kind has none, which is every kind on the stock product.
321
+ */
322
+ variantsForKind(kind: AgentKind): AgentKindVariantDefinition[];
298
323
  }
299
324
  /**
300
325
  * A fresh registry pre-loaded with the built-in agent kinds. This is the single place the
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,MAAM,EACP,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AACpG,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEnE,OAAO,KAA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AE,CAEvC;IAED;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,0BAA0B,EAAE,CAE7D;CACF;AAiBD;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,iBAAiB,CAgB5D"}
@@ -58,6 +58,11 @@ export class AgentKindRegistry {
58
58
  // its house playbook or its issue-tracker MCP server without redefining the kind's prompt.
59
59
  assignedSkills = new Map();
60
60
  assignedToolServers = new Map();
61
+ // VARIANTS of existing kinds (id → definition) — an alternate prompt a step selects through
62
+ // `stepOptions.agentVariantId`. They live here beside the kinds and their capabilities for the
63
+ // same reason those do, but they are deliberately NOT kinds: a variant never appears in
64
+ // `all()`, never answers `get()`, and never changes a behavioural answer. See ./variants.
65
+ variantDefinitions = new Map();
61
66
  constructor() {
62
67
  for (const definition of STANDARD_TRAIT_DEFINITIONS) {
63
68
  this.traitDefinitions.set(definition.id, definition);
@@ -271,6 +276,40 @@ export class AgentKindRegistry {
271
276
  return EMPTY_TOOL_REFS;
272
277
  return normalizeToolRefs([...own, ...assigned], (id) => this.toolServerDefinitions.get(id));
273
278
  }
279
+ /**
280
+ * Register a VARIATION of an existing agent kind — an alternate prompt a pipeline step selects
281
+ * by id, running the base kind in every other respect. A later registration of the same id
282
+ * replaces the earlier one, which is also how a deployment RE-WORDS a variant an installed
283
+ * package shipped without forking it — safe for Kaizen because a step is keyed by a fingerprint
284
+ * of the text its variant contributed, not by the id alone (see `AppliedAgentVariant`).
285
+ *
286
+ * Nothing is validated here (an id may legitimately be registered before its base kind is):
287
+ * `validateRegistrations` reports an unknown base, a collision with a kind id, and a variant
288
+ * that changes no text, as startup errors.
289
+ */
290
+ registerVariant(definition) {
291
+ this.variantDefinitions.set(definition.id, definition);
292
+ }
293
+ /** Register several variants at once. */
294
+ registerVariants(definitions) {
295
+ for (const definition of definitions)
296
+ this.registerVariant(definition);
297
+ }
298
+ /** A registered variant, or undefined when the id is unknown. */
299
+ variant(id) {
300
+ return this.variantDefinitions.get(id);
301
+ }
302
+ /** All registered variants (registration order). */
303
+ variants() {
304
+ return [...this.variantDefinitions.values()];
305
+ }
306
+ /**
307
+ * The variants registered for one kind — what the pipeline builder offers on a step of that
308
+ * kind. Empty when the kind has none, which is every kind on the stock product.
309
+ */
310
+ variantsForKind(kind) {
311
+ return this.variants().filter((variant) => variant.baseKind === kind);
312
+ }
274
313
  }
275
314
  /** Shared empty set so `assignedTraitsFor` allocates nothing on the common no-assignment path. */
276
315
  const EMPTY_TRAIT_SET = new Set();
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/agents/kinds/registry.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAGxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAuK/C;;;;GAIG;AACH,SAAS,i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MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAY;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAY;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAY;CACtC,CAAC,CAAA;AACF,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAY;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAY;CACtC,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAA;IACxC,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IACtC,yBAAyB,CAAC,QAAQ,CAAC,CAAA;IACnC,uBAAuB,CAAC,QAAQ,CAAC,CAAA;IACjC,kCAAkC,CAAC,QAAQ,CAAC,CAAA;IAC5C,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IAChC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IAC5B,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IAChC,0BAA0B,CAAC,QAAQ,CAAC,CAAA;IACpC,wBAAwB,CAAC,QAAQ,CAAC,CAAA;IAClC,2BAA2B,CAAC,QAAQ,CAAC,CAAA;IACrC,+BAA+B,CAAC,QAAQ,CAAC,CAAA;IACzC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IAC5B,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IAC5B,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -59,6 +59,28 @@ export declare const INTERVIEW_GATE_TRAIT: AgentTrait;
59
59
  * so the trait only affects kinds whose standards are folded into the prompt.
60
60
  */
61
61
  export declare const BRIEF_STANDARDS_TRAIT: AgentTrait;
62
+ /**
63
+ * DESIGN-time kinds that choose which shared FOUNDATIONAL SERVICES a solution consumes. The
64
+ * engine injects the workspace's catalog (identity + capabilities + operation names, never a
65
+ * contract document) as `.cat-context/foundational-services/catalog.md`, and the guidance below
66
+ * requires the kind to declare the ids it designed against in a machine-readable block. That
67
+ * declaration is what the downstream `foundational-contracts` kinds' lazy read keys off — the
68
+ * whole point of splitting the two traits is that a design step pays for the cheap catalog and
69
+ * only the services it actually picked cost anyone a document.
70
+ */
71
+ export declare const FOUNDATIONAL_CATALOG_TRAIT: AgentTrait;
72
+ /**
73
+ * CONSUMER kinds that need the API details of the services the design declared. The engine
74
+ * resolves those ids to their full contract documents and injects one file per service. The
75
+ * guidance points at the index rather than restating the catalog: a consumer must not be
76
+ * choosing services, and handing it the whole catalog is how a coder ends up adopting a shared
77
+ * service the design deliberately rejected.
78
+ */
79
+ export declare const FOUNDATIONAL_CONTRACTS_TRAIT: AgentTrait;
80
+ /** The guidance a design-time kind gets: consult the catalog, then DECLARE what it used. */
81
+ export declare const FOUNDATIONAL_CATALOG_GUIDANCE: string;
82
+ /** The guidance a consumer kind gets: the contracts are files, and they are authoritative. */
83
+ export declare const FOUNDATIONAL_CONTRACTS_GUIDANCE: string;
62
84
  /** The guidance appended to a spec-aware kind's system prompt — explains the spec format. */
63
85
  export declare const SPEC_AWARE_GUIDANCE: string;
64
86
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EAGf,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,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B,EAAE,SAAS,oBAAoB,EAQrE,CAAA;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,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;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAQvF"}
@@ -1,5 +1,5 @@
1
1
  import { SPEC_FEATURES_DIR, SPEC_MODULES_DIR, SPEC_OVERVIEW_PATH } from '@cat-factory/contracts';
2
- import { DOC_INTERVIEWER_AGENT_KIND, INITIATIVE_INTERVIEWER_AGENT_KIND, } from '@cat-factory/kernel';
2
+ import { DOC_INTERVIEWER_AGENT_KIND, FOUNDATIONAL_CATALOG_FILE, FOUNDATIONAL_CONTEXT_DIR, FOUNDATIONAL_DECLARATION_TAG, FOUNDATIONAL_INDEX_FILE, INITIATIVE_INTERVIEWER_AGENT_KIND, } from '@cat-factory/kernel';
3
3
  /**
4
4
  * Code-aware kinds read and/or change the service's code. The service's selected
5
5
  * best-practice / guideline fragments (Node, Fastify, performance, …) are folded into
@@ -57,6 +57,37 @@ export const INTERVIEW_GATE_TRAIT = 'interview-gate';
57
57
  * so the trait only affects kinds whose standards are folded into the prompt.
58
58
  */
59
59
  export const BRIEF_STANDARDS_TRAIT = 'brief-standards';
60
+ /**
61
+ * DESIGN-time kinds that choose which shared FOUNDATIONAL SERVICES a solution consumes. The
62
+ * engine injects the workspace's catalog (identity + capabilities + operation names, never a
63
+ * contract document) as `.cat-context/foundational-services/catalog.md`, and the guidance below
64
+ * requires the kind to declare the ids it designed against in a machine-readable block. That
65
+ * declaration is what the downstream `foundational-contracts` kinds' lazy read keys off — the
66
+ * whole point of splitting the two traits is that a design step pays for the cheap catalog and
67
+ * only the services it actually picked cost anyone a document.
68
+ */
69
+ export const FOUNDATIONAL_CATALOG_TRAIT = 'foundational-catalog';
70
+ /**
71
+ * CONSUMER kinds that need the API details of the services the design declared. The engine
72
+ * resolves those ids to their full contract documents and injects one file per service. The
73
+ * guidance points at the index rather than restating the catalog: a consumer must not be
74
+ * choosing services, and handing it the whole catalog is how a coder ends up adopting a shared
75
+ * service the design deliberately rejected.
76
+ */
77
+ export const FOUNDATIONAL_CONTRACTS_TRAIT = 'foundational-contracts';
78
+ /** The guidance a design-time kind gets: consult the catalog, then DECLARE what it used. */
79
+ export const FOUNDATIONAL_CATALOG_GUIDANCE = [
80
+ `This deployment runs shared FOUNDATIONAL SERVICES — capabilities such as file storage, notifications or audit that already exist and that new systems are expected to CONSUME rather than rebuild. The catalog of what is available is provided to you as \`.cat-context/${FOUNDATIONAL_CATALOG_FILE}\`; read it before you settle on a design.`,
81
+ `Prefer an existing foundational service over designing your own equivalent. When you reject one that looks applicable, say why — "we already have this" is the single most common avoidable finding in a design review.`,
82
+ `The catalog lists each service's operations but NOT its full API documents. Design against the operations you can see; do not invent endpoints, fields or semantics the catalog does not show. The implementation steps get the full contracts.`,
83
+ `END your reply with a fenced \`\`\`${FOUNDATIONAL_DECLARATION_TAG} block listing the service ids your design consumes, one per line, and nothing else in the block. Write \`none\` when your design consumes no foundational service. This block is machine-read: the ids you list are what the later implementation steps are handed the API contracts for, so a service you omit is one nobody downstream will have the interface to, and an id you invent will be reported as unavailable.`,
84
+ ].join('\n');
85
+ /** The guidance a consumer kind gets: the contracts are files, and they are authoritative. */
86
+ export const FOUNDATIONAL_CONTRACTS_GUIDANCE = [
87
+ `The FOUNDATIONAL SERVICES the design chose for this task — shared capabilities such as file storage, notifications or audit — have their API contracts provided to you under \`.cat-context/${FOUNDATIONAL_CONTEXT_DIR}/\`. Start at \`.cat-context/${FOUNDATIONAL_INDEX_FILE}\`, which names each one and states anything the design asked for that could not be provided.`,
88
+ `Treat those contracts as the authoritative interface: call the operations they declare, with the shapes they declare. Do not invent an endpoint or a field, and do not reimplement a capability one of these services already provides.`,
89
+ `If the work needs something the provided contracts do not cover, say so in your report rather than guessing at the missing API.`,
90
+ ].join('\n');
60
91
  /** The guidance appended to a spec-aware kind's system prompt — explains the spec format. */
61
92
  export const SPEC_AWARE_GUIDANCE = [
62
93
  `This repository may contain a prescriptive SPECIFICATION for the service under the \`spec/\` directory — the source of truth for what the service must do. It is sharded by a module (domain) → feature (group) taxonomy. When it is present, read it before doing the work:`,
@@ -83,8 +114,14 @@ export const SPEC_AWARE_GUIDANCE = [
83
114
  * `reviewer` companion is a built-in listed here while the coder declares its own).
84
115
  */
85
116
  export const STANDARD_AGENT_TRAITS = {
86
- architect: [CODE_AWARE_TRAIT, SPEC_AWARE_TRAIT],
87
- coder: [CODE_AWARE_TRAIT, SPEC_AWARE_TRAIT, BRIEF_STANDARDS_TRAIT],
117
+ // The architect DESIGNS, so it is the one built-in kind that chooses foundational services
118
+ // and declares them; `researcher` and `coder` CONSUME that declaration.
119
+ architect: [CODE_AWARE_TRAIT, SPEC_AWARE_TRAIT, FOUNDATIONAL_CATALOG_TRAIT],
120
+ coder: [CODE_AWARE_TRAIT, SPEC_AWARE_TRAIT, BRIEF_STANDARDS_TRAIT, FOUNDATIONAL_CONTRACTS_TRAIT],
121
+ // The researcher plans the solution against the design, so it needs the same contracts the
122
+ // coder will build to — investigating prior art for a capability the org already runs, from
123
+ // the catalog entry alone, is how a plan ends up proposing a library beside a shared service.
124
+ researcher: [FOUNDATIONAL_CONTRACTS_TRAIT],
88
125
  reviewer: [CODE_AWARE_TRAIT, SPEC_AWARE_TRAIT],
89
126
  'ci-fixer': [CODE_AWARE_TRAIT, SPEC_AWARE_TRAIT, BRIEF_STANDARDS_TRAIT],
90
127
  fixer: [CODE_AWARE_TRAIT, SPEC_AWARE_TRAIT, BRIEF_STANDARDS_TRAIT],
@@ -124,6 +161,8 @@ export const STANDARD_TRAIT_DEFINITIONS = [
124
161
  { id: SPEC_AWARE_TRAIT, guidance: SPEC_AWARE_GUIDANCE },
125
162
  { id: INTERVIEW_GATE_TRAIT },
126
163
  { id: BRIEF_STANDARDS_TRAIT },
164
+ { id: FOUNDATIONAL_CATALOG_TRAIT, guidance: FOUNDATIONAL_CATALOG_GUIDANCE },
165
+ { id: FOUNDATIONAL_CONTRACTS_TRAIT, guidance: FOUNDATIONAL_CONTRACTS_GUIDANCE },
127
166
  ];
128
167
  /**
129
168
  * The traits a kind carries: its built-in set ({@link STANDARD_AGENT_TRAITS}) unioned with a
@@ -1 +1 @@
1
- {"version":3,"file":"traits.js","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChG,OAAO,EAEL,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,qBAAqB,CAAA;AAmB5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,YAAY,CAAA;AAExD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAe,WAAW,CAAA;AAEtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,YAAY,CAAA;AAExD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAe,gBAAgB,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAe,gBAAgB,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAe,iBAAiB,CAAA;AAElE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,8QAA8Q;IAC9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,CAAC,QAAQ;YAAE,SAAQ;QACvB,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACxE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,115 @@
1
+ import type { AgentKind } from '@cat-factory/kernel';
2
+ /** How a variant is labelled wherever a step's agent kind is shown. */
3
+ export interface AgentKindVariantPresentation {
4
+ /**
5
+ * Short distinguishing name, shown BESIDE the base kind's own label (`Coder · TDD-first`)
6
+ * rather than in place of it — the step really is a Coder step, and a label that hid that
7
+ * would make the run harder to read, not easier.
8
+ */
9
+ label: string;
10
+ /** One sentence on what this variant changes, for the step-option picker's tooltip. */
11
+ description?: string;
12
+ }
13
+ /**
14
+ * A registered variation of an existing agent kind: its alternate prompt plus the identity the
15
+ * pipeline builder and the run views show it under.
16
+ *
17
+ * At least one of {@link systemPrompt} / {@link promptAddition} must be set — a variant that
18
+ * changes no text is a step option with no effect, which boot validation reports rather than
19
+ * letting it run as a silently ordinary step.
20
+ */
21
+ export interface AgentKindVariantDefinition {
22
+ /**
23
+ * The variant id named by a step's `stepOptions.agentVariantId`. Free-form; namespace it the
24
+ * way a deployment namespaces anything else it registers (`acme:coder-tdd`).
25
+ */
26
+ id: string;
27
+ /**
28
+ * The EXISTING agent kind this varies. The step runs as this kind in every respect; the
29
+ * variant supplies only its prompt. Boot validation refuses an unknown one.
30
+ *
31
+ * It must also be a kind the DISPATCH composes a prompt for. The inline ENGINE kinds
32
+ * (`INLINE_ENGINE_SYSTEM_PROMPTS` — the requirements + clarity reviewers, both brainstorm
33
+ * stages, their rework editors) are refused: `IterativeReviewService` composes their prompt from
34
+ * (workspace, kind) with no step in hand, so a variant selected on such a step could never reach
35
+ * the model, and a per-workspace prompt override is what varies them today. The bespoke
36
+ * CONTAINER kinds (`merger`, `on-call`) are fine — they dispatch through the engine like any
37
+ * other container kind, against their ROLE half.
38
+ */
39
+ baseKind: AgentKind;
40
+ /**
41
+ * REPLACES the kind's shipped track prompt outright — for a variant whose role is genuinely
42
+ * different prose, not a rider on the shipped one.
43
+ *
44
+ * Prefer {@link promptAddition} where it will do: a replacement is a copy of the shipped
45
+ * prompt that stops tracking it the day the product edits it, which is the same staleness a
46
+ * per-workspace override carries. What it CANNOT do is drop a platform invariant — those are
47
+ * re-applied on top (see the file header).
48
+ */
49
+ systemPrompt?: string;
50
+ /**
51
+ * APPENDED to whatever base prompt this dispatch runs under — the shipped one, this variant's
52
+ * {@link systemPrompt}, or the workspace's own override of it. That is what makes an addition
53
+ * the safe default: it steers the kind without forking its prompt, so both the product's edits
54
+ * and a workspace's keep applying underneath.
55
+ */
56
+ promptAddition?: string;
57
+ /** Display metadata. Omitted ⇒ the SPA shows the variant's raw id. */
58
+ presentation?: AgentKindVariantPresentation;
59
+ }
60
+ /**
61
+ * How much of what a selected variant declares actually reached the prompt a step ran under.
62
+ *
63
+ * A variant loses its `systemPrompt` to a workspace override, because the workspace is the
64
+ * narrower tier — so "a variant was selected" and "the variant shaped this prompt" are different
65
+ * facts, and a reader shown only the first would be told something untrue. The three losing
66
+ * cases are kept APART rather than collapsed into one "didn't apply", because they need
67
+ * different fixes: drop the workspace's edit, drop the variant's replacement in favour of an
68
+ * addition, or re-register the variant.
69
+ *
70
+ * - `full` — everything the variant declares is in the effective prompt.
71
+ * - `addition-only` — a workspace override displaced its `systemPrompt`; its `promptAddition`
72
+ * still folded on top.
73
+ * - `superseded` — a workspace override displaced its `systemPrompt` and it had no addition, so
74
+ * nothing of it survives.
75
+ * - `withdrawn` — the id the step names is not registered (resolved by the caller, which is the
76
+ * only place that knows the lookup failed).
77
+ */
78
+ export type AgentVariantApplication = 'full' | 'addition-only' | 'superseded' | 'withdrawn';
79
+ /** The effective prompt for one dispatch plus what the variant contributed to it. */
80
+ export interface AppliedAgentVariant {
81
+ /**
82
+ * The effective system-prompt override, or undefined to run the shipped prompt — so an
83
+ * unvaried, unedited step's dispatch is byte-for-byte what it always sent, the same
84
+ * "absent ⇒ shipped" contract `AgentRunContext.systemPromptOverride` already has.
85
+ */
86
+ prompt?: string;
87
+ /** How much of the variant survived into {@link prompt}. */
88
+ applied: AgentVariantApplication;
89
+ /**
90
+ * Fingerprint of the text the variant actually CONTRIBUTED, absent when it contributed none.
91
+ *
92
+ * This is what stops a re-worded variant from inheriting the verification its previous wording
93
+ * earned — the same hazard the workspace revision suffix (`wN`) exists for, which a bare id
94
+ * cannot express because re-registering an id is a supported way to re-word a variant. It
95
+ * fingerprints the CONTRIBUTION rather than the definition so the key describes the text that
96
+ * ran: a variant whose replacement was displaced is keyed by the addition that survived, and
97
+ * one that contributed nothing does not enter the key at all.
98
+ */
99
+ fingerprint?: string;
100
+ }
101
+ /**
102
+ * The effective system-prompt override for one dispatch: the variant's replacement (unless a
103
+ * workspace override already replaced the track prompt — the narrower tier wins, as it does for
104
+ * every other per-dispatch knob) plus the variant's addition folded onto whichever base survived.
105
+ *
106
+ * `shipped` is passed in rather than resolved here because the caller (the engine) is the one
107
+ * place that knows the kind actually being dispatched; see `shippedBasePromptFor`, which is what
108
+ * it resolves it with.
109
+ *
110
+ * Called with NO variant (an ordinary step, varied or not by the workspace alone) this is just
111
+ * the workspace override passed through, and `applied` is vacuously `full` — there is nothing to
112
+ * lose. Only a caller that named a variant id reads it.
113
+ */
114
+ export declare function applyAgentVariant(shipped: string, variant: AgentKindVariantDefinition | undefined, workspaceOverride?: string): AppliedAgentVariant;
115
+ //# sourceMappingURL=variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/variants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AA2BpD,uEAAuE;AACvE,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;;;;;;;;;OAWG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sEAAsE;IACtE,YAAY,CAAC,EAAE,4BAA4B,CAAA;CAC5C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,GAAG,WAAW,CAAA;AAE3F,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4DAA4D;IAC5D,OAAO,EAAE,uBAAuB,CAAA;IAChC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,0BAA0B,GAAG,SAAS,EAC/C,iBAAiB,CAAC,EAAE,MAAM,GACzB,mBAAmB,CAqBrB"}
@@ -0,0 +1,35 @@
1
+ import { contentHash } from '@cat-factory/kernel';
2
+ /**
3
+ * The effective system-prompt override for one dispatch: the variant's replacement (unless a
4
+ * workspace override already replaced the track prompt — the narrower tier wins, as it does for
5
+ * every other per-dispatch knob) plus the variant's addition folded onto whichever base survived.
6
+ *
7
+ * `shipped` is passed in rather than resolved here because the caller (the engine) is the one
8
+ * place that knows the kind actually being dispatched; see `shippedBasePromptFor`, which is what
9
+ * it resolves it with.
10
+ *
11
+ * Called with NO variant (an ordinary step, varied or not by the workspace alone) this is just
12
+ * the workspace override passed through, and `applied` is vacuously `full` — there is nothing to
13
+ * lose. Only a caller that named a variant id reads it.
14
+ */
15
+ export function applyAgentVariant(shipped, variant, workspaceOverride) {
16
+ const replacement = variant?.systemPrompt;
17
+ const replaced = workspaceOverride ?? replacement;
18
+ const addition = variant?.promptAddition?.trim();
19
+ const displaced = Boolean(replacement) && workspaceOverride !== undefined;
20
+ if (!addition) {
21
+ return {
22
+ ...(replaced === undefined ? {} : { prompt: replaced }),
23
+ applied: displaced ? 'superseded' : 'full',
24
+ ...(displaced || !replacement ? {} : { fingerprint: contentHash(replacement) }),
25
+ };
26
+ }
27
+ return {
28
+ prompt: `${replaced ?? shipped}\n\n${addition}`,
29
+ applied: displaced ? 'addition-only' : 'full',
30
+ // The contribution, which is the addition alone once a workspace override displaced the
31
+ // replacement — see {@link AppliedAgentVariant.fingerprint}.
32
+ fingerprint: contentHash(displaced || !replacement ? addition : `${replacement}\n\n${addition}`),
33
+ };
34
+ }
35
+ //# sourceMappingURL=variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.js","sourceRoot":"","sources":["../../../src/agents/kinds/variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAmIjD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAe,EACf,OAA+C,EAC/C,iBAA0B;IAE1B,MAAM,WAAW,GAAG,OAAO,EAAE,YAAY,CAAA;IACzC,MAAM,QAAQ,GAAG,iBAAiB,IAAI,WAAW,CAAA;IACjD,MAAM,QAAQ,GAAG,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,CAAA;IAChD,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,iBAAiB,KAAK,SAAS,CAAA;IACzE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO;YACL,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;YACvD,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM;YAC1C,GAAG,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;SAChF,CAAA;IACH,CAAC;IACD,OAAO;QACL,MAAM,EAAE,GAAG,QAAQ,IAAI,OAAO,OAAO,QAAQ,EAAE;QAC/C,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM;QAC7C,wFAAwF;QACxF,6DAA6D;QAC7D,WAAW,EAAE,WAAW,CACtB,SAAS,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,WAAW,OAAO,QAAQ,EAAE,CACvE;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,72 @@
1
+ import type { AgentKind } from '@cat-factory/kernel';
2
+ import type { AgentKindRegistry } from '../kinds/registry.js';
3
+ import type { BespokeSystemPrompt } from './bespoke.js';
4
+ /**
5
+ * The EDITABLE half of the `merger` prompt: what the agent is for. Replaced wholesale by a
6
+ * workspace override, so it must carry no invariant the engine depends on.
7
+ */
8
+ export declare const MERGER_ROLE_PROMPT: string;
9
+ /**
10
+ * The NON-EDITABLE half: the JSON contract `resolveMergerStep` parses, and the rule that keeps a
11
+ * reasoning model's answer out of its hidden channel. Re-appended on top of an override — an
12
+ * override that could drop these fails the run in exactly the ways they exist to prevent (an
13
+ * empty visible reply the harness reads as unusable; a merge decision with nothing to parse).
14
+ */
15
+ export declare const MERGER_DIRECTIVES: string;
16
+ /** Role prompt the `merger` step runs under (scores the PR; returns JSON only). */
17
+ export declare const MERGER_SYSTEM_PROMPT: string;
18
+ /**
19
+ * The EDITABLE half of the `on-call` prompt: what the agent is investigating and how to weigh
20
+ * it. Replaced wholesale by a workspace override — note that the read-only guardrail is
21
+ * deliberately NOT here, since an on-call agent that could be told to commit is the specific
22
+ * accident this split prevents.
23
+ */
24
+ export declare const ON_CALL_ROLE_PROMPT: string;
25
+ /**
26
+ * The NON-EDITABLE half: the read-only guardrail (this kind investigates, a human decides
27
+ * whether to revert — see `resolveOnCallStep`), the JSON contract the engine parses, and the
28
+ * answer-in-your-reply rule. Re-appended on top of an override.
29
+ */
30
+ export declare const ON_CALL_DIRECTIVES: string;
31
+ /** Role prompt the `on-call` step runs under (investigates a regression; returns JSON only). */
32
+ export declare const ON_CALL_SYSTEM_PROMPT: string;
33
+ /**
34
+ * Every kind whose prompt is a bespoke constant rather than a `systemPromptFor` composition,
35
+ * keyed by agent kind and SPLIT at the boundary a replacement may cross
36
+ * ({@link BespokeSystemPrompt}).
37
+ *
38
+ * Two families, for the same reason. The container kinds `merger` and `on-call` dispatch a
39
+ * bespoke constant (both return a strict JSON assessment whose contract is stated in that
40
+ * prompt); the inline ENGINE steps — the requirements + clarity reviewers, both brainstorm
41
+ * stages, their rework editors and the Requirement Writer — are driven by
42
+ * `IterativeReviewService` as bare inline calls. Neither family passes through `systemPromptFor`,
43
+ * so neither gets its override applied or its invariants re-appended by that seam.
44
+ *
45
+ * Collected here so the prompt EDITOR, the RUN and a code-registered VARIANT agree on what "the
46
+ * built-in prompt for this kind" is. With the constants only inlined, an editor built on
47
+ * `systemPromptFor` showed the merger's thin one-line role — and the requirements reviewer's
48
+ * `roles.ts` line — as the baseline while something else entirely ran: "restore the built-in"
49
+ * restored a prompt that was never running, and a diff against the baseline was noise.
50
+ *
51
+ * Adding another such kind means adding it here, SPLIT — a kind added with its directives inside
52
+ * `role` compiles and runs fine, and fails only later, as a workspace that edited it loses its
53
+ * guardrail or its JSON contract.
54
+ *
55
+ * The two container kind ids are bare literals: their canonical constants live in kernel
56
+ * (`ON_CALL_AGENT_KIND`) and orchestration (`MERGER_AGENT_KIND`), and this package sits below
57
+ * both. Pinned by `promptOverrides.spec.ts`, which resolves them through those constants.
58
+ */
59
+ export declare const BESPOKE_SYSTEM_PROMPTS: Partial<Record<AgentKind, BespokeSystemPrompt>>;
60
+ /**
61
+ * The SHIPPED prompt for a kind — the unit a per-workspace override or a registered variant
62
+ * REPLACES, and what the prompt editor shows as the baseline to diff against and restore to.
63
+ *
64
+ * It excludes the surface directives and trait guidance `systemPromptFor` layers on (and, for a
65
+ * bespoke kind, its `directives` half), because those are invariants of how the platform runs
66
+ * the kind (a read-only kind must not edit; a reasoning kind's answer must land in its visible
67
+ * reply) rather than editorial content. They are re-applied on top of a replacement, so handing
68
+ * them to an editor would only let someone delete something that comes back anyway — or, worse,
69
+ * duplicate it on save.
70
+ */
71
+ export declare function shippedBasePromptFor(kind: AgentKind, registry: AgentKindRegistry): string;
72
+ //# sourceMappingURL=bespoke-kinds.d.ts.map
@@ -0,0 +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;AAE7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAwBvD;;;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,CAIlF,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAEzF"}