@cat-factory/consensus 0.12.19 → 0.13.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/ConsensusAgentExecutor.d.ts.map +1 -1
- package/dist/ConsensusAgentExecutor.js +18 -3
- package/dist/ConsensusAgentExecutor.js.map +1 -1
- package/dist/gating.d.ts +8 -0
- package/dist/gating.d.ts.map +1 -1
- package/dist/gating.js +10 -14
- package/dist/gating.js.map +1 -1
- package/dist/traits.d.ts +29 -9
- package/dist/traits.d.ts.map +1 -1
- package/dist/traits.js +34 -10
- package/dist/traits.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsensusAgentExecutor.d.ts","sourceRoot":"","sources":["../src/ConsensusAgentExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAEvB,KAAK,0BAA0B,EAG/B,KAAK,uBAAuB,EAG5B,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EASlB,MAAM,qBAAqB,CAAA;AAO5B,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,kCAAkC;IACjD;;;;;OAKG;IACH,QAAQ,EAAE,aAAa,CAAA;IACvB,iFAAiF;IACjF,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,yEAAyE;IACzE,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,YAAY,EAAE,YAAY,CAAA;IAC1B,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,QAAQ,GAAG,SAAS,CAA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D;;;;;;GAMG;AACH,qBAAa,sBAAuB,YAAW,kBAAkB;IAC/D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoC;IACzD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAuD;IACzF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD,YAAY,IAAI,EAAE,kCAAkC,EASnD;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;YAQT,WAAW;IAiBzB,OAAO,CAAC,OAAO;IAmBf,iGAAiG;IACjG,OAAO,CAAC,aAAa;IAaf,GAAG,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAkI3D;YAEa,IAAI;IAcZ,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAOxE;IAED,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAIvD;IAKD,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAG3C;IAED,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAK1D;IAED,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAKvD;IAEK,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAInD;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describeError, inlineModelRef, isAsyncAgentExecutor, } from '@cat-factory/kernel';
|
|
2
|
-
import { composeBlockSystemPrompt, defaultAgentKindRegistry, resolveAgentConfig, resolveInlineModelRef,
|
|
2
|
+
import { composeBlockSystemPrompt, defaultAgentKindRegistry, INLINE_PANEL_SURFACE, resolveAgentConfig, resolveInlineModelRef, standardsVerbosityFor, systemPromptFor, userPromptFor, } from '@cat-factory/agents';
|
|
3
3
|
import { decideConsensusMode } from './gating.js';
|
|
4
4
|
import { isConsensusEligible } from './traits.js';
|
|
5
5
|
import { runSpecialistPanel } from './strategies/specialistPanel.js';
|
|
@@ -100,16 +100,26 @@ export class ConsensusAgentExecutor {
|
|
|
100
100
|
const provider = await this.providerFor(context);
|
|
101
101
|
const base = await this.baseRef(context);
|
|
102
102
|
const config = resolveAgentConfig(this.deps.agentRouting, context.agentKind);
|
|
103
|
-
const
|
|
103
|
+
const composedSystem = composeBlockSystemPrompt(
|
|
104
104
|
// Same precedence the single-actor inline executor applies: the workspace's own prompt
|
|
105
105
|
// for this kind wins over the deployment-wide `AGENT_ROUTING` system prompt, and
|
|
106
106
|
// `systemPromptFor` re-applies the engine-enforced directives on top of it.
|
|
107
107
|
context.systemPromptOverride
|
|
108
108
|
? systemPromptFor(context.agentKind, this.agentKindRegistry, context.systemPromptOverride)
|
|
109
|
-
: (config.system ?? systemPromptFor(context.agentKind, this.agentKindRegistry)), context.block, this.agentKindRegistry.standardsDelivery(context.agentKind),
|
|
109
|
+
: (config.system ?? systemPromptFor(context.agentKind, this.agentKindRegistry)), context.block, this.agentKindRegistry.standardsDelivery(context.agentKind),
|
|
110
|
+
// An inline call has no filesystem, so a `context-files` kind's standards were never
|
|
111
|
+
// really delivered as files: fold them into the SYSTEM prompt here, at this kind's
|
|
112
|
+
// verbosity. `userPromptFor` correspondingly leaves the standards files out of its own
|
|
113
|
+
// fold, so each standard reaches the model exactly once and at the right length.
|
|
114
|
+
false,
|
|
110
115
|
// Same per-kind verbosity the single-actor executors resolve: a consensus session runs the
|
|
111
116
|
// SAME kind, so an implementer kind must not silently regain the full standards here.
|
|
112
117
|
standardsVerbosityFor(context.agentKind, this.agentKindRegistry));
|
|
118
|
+
// Most consensus-eligible kinds are CONTAINER kinds whose shipped prompt is written for a
|
|
119
|
+
// real checkout (run `git diff`, read `.cat-context/*`, dispatch slice subagents). A panel
|
|
120
|
+
// participant is a plain inline call with none of that, so the surface it is actually on is
|
|
121
|
+
// stated last — after any workspace override, which must not be able to drop it.
|
|
122
|
+
const baseSystem = `${composedSystem}\n\n${INLINE_PANEL_SURFACE}`;
|
|
113
123
|
const goalPrompt = userPromptFor(context, this.agentKindRegistry);
|
|
114
124
|
const participants = cfg.participants.map((p) => {
|
|
115
125
|
const ref = this.refForModelId(p.modelId, base);
|
|
@@ -134,6 +144,11 @@ export class ConsensusAgentExecutor {
|
|
|
134
144
|
agentKind: context.agentKind,
|
|
135
145
|
strategy: cfg.strategy,
|
|
136
146
|
status: 'running',
|
|
147
|
+
// Which workspace consensus GROUP the engine selected for this dispatch, when the step
|
|
148
|
+
// named a tier set. Copied onto the transcript (rather than looked up later) so the
|
|
149
|
+
// session still says which panel fired after the library row is edited or deleted.
|
|
150
|
+
groupId: cfg.selectedGroup?.id ?? null,
|
|
151
|
+
groupName: cfg.selectedGroup?.name ?? null,
|
|
137
152
|
participants: cfg.participants,
|
|
138
153
|
rounds: [],
|
|
139
154
|
synthesis: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsensusAgentExecutor.js","sourceRoot":"","sources":["../src/ConsensusAgentExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,aAAa,EAEb,cAAc,EACd,oBAAoB,GAKrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAGL,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"ConsensusAgentExecutor.js","sourceRoot":"","sources":["../src/ConsensusAgentExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,aAAa,EAEb,cAAc,EACd,oBAAoB,GAKrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAGL,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,aAAa,GACd,MAAM,qBAAqB,CA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* `standard`) — configuring gating means you must give it at least one bar.
|
|
11
11
|
* - Gating enabled, estimate absent → `gating.onMissingEstimate` (default `consensus`,
|
|
12
12
|
* fail-safe to thoroughness: we couldn't prove the task is low-stakes).
|
|
13
|
+
*
|
|
14
|
+
* The rule itself lives in kernel as {@link clearsConsensusBar}, and this is deliberately a thin
|
|
15
|
+
* naming of its two outcomes rather than a second implementation. The engine has to answer the
|
|
16
|
+
* identical question BEFORE any executor exists — it ranks a step's candidate consensus GROUPS by
|
|
17
|
+
* the bar each one sets and materialises the winner — so a private copy of the axis comparison
|
|
18
|
+
* here would be a second chance for the tier a workspace was promised and the panel that actually
|
|
19
|
+
* runs to disagree. That divergence is precisely what `applyConsensusGroup` drops the step's
|
|
20
|
+
* `gating` to prevent, and a duplicated predicate would have reintroduced it one edit later.
|
|
13
21
|
*/
|
|
14
22
|
export declare function decideConsensusMode(estimate: TaskEstimate | null | undefined, gating: ConsensusGating | undefined): ConsensusMode;
|
|
15
23
|
//# sourceMappingURL=gating.d.ts.map
|
package/dist/gating.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gating.d.ts","sourceRoot":"","sources":["../src/gating.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAMxE,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,CAAA;AAEpD
|
|
1
|
+
{"version":3,"file":"gating.d.ts","sourceRoot":"","sources":["../src/gating.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAMxE,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,CAAA;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACzC,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,aAAa,CAEf"}
|
package/dist/gating.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { clearsConsensusBar } from '@cat-factory/kernel';
|
|
1
2
|
/**
|
|
2
3
|
* Decide whether to run consensus given the task estimate and the step's gating config.
|
|
3
4
|
*
|
|
@@ -8,21 +9,16 @@
|
|
|
8
9
|
* `standard`) — configuring gating means you must give it at least one bar.
|
|
9
10
|
* - Gating enabled, estimate absent → `gating.onMissingEstimate` (default `consensus`,
|
|
10
11
|
* fail-safe to thoroughness: we couldn't prove the task is low-stakes).
|
|
12
|
+
*
|
|
13
|
+
* The rule itself lives in kernel as {@link clearsConsensusBar}, and this is deliberately a thin
|
|
14
|
+
* naming of its two outcomes rather than a second implementation. The engine has to answer the
|
|
15
|
+
* identical question BEFORE any executor exists — it ranks a step's candidate consensus GROUPS by
|
|
16
|
+
* the bar each one sets and materialises the winner — so a private copy of the axis comparison
|
|
17
|
+
* here would be a second chance for the tier a workspace was promised and the panel that actually
|
|
18
|
+
* runs to disagree. That divergence is precisely what `applyConsensusGroup` drops the step's
|
|
19
|
+
* `gating` to prevent, and a duplicated predicate would have reintroduced it one edit later.
|
|
11
20
|
*/
|
|
12
21
|
export function decideConsensusMode(estimate, gating) {
|
|
13
|
-
|
|
14
|
-
return 'consensus';
|
|
15
|
-
if (!estimate)
|
|
16
|
-
return gating.onMissingEstimate ?? 'consensus';
|
|
17
|
-
const axes = [
|
|
18
|
-
[gating.minComplexity, estimate.complexity],
|
|
19
|
-
[gating.minRisk, estimate.risk],
|
|
20
|
-
[gating.minImpact, estimate.impact],
|
|
21
|
-
];
|
|
22
|
-
for (const [threshold, value] of axes) {
|
|
23
|
-
if (threshold !== undefined && value >= threshold)
|
|
24
|
-
return 'consensus';
|
|
25
|
-
}
|
|
26
|
-
return 'standard';
|
|
22
|
+
return clearsConsensusBar(gating, estimate) ? 'consensus' : 'standard';
|
|
27
23
|
}
|
|
28
24
|
//# sourceMappingURL=gating.js.map
|
package/dist/gating.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gating.js","sourceRoot":"","sources":["../src/gating.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gating.js","sourceRoot":"","sources":["../src/gating.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAOxD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAyC,EACzC,MAAmC;IAEnC,OAAO,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAA;AACxE,CAAC"}
|
package/dist/traits.d.ts
CHANGED
|
@@ -9,16 +9,36 @@ export declare const STRATEGY_TRAIT: Record<ConsensusStrategy, string>;
|
|
|
9
9
|
export declare const CONSENSUS_TRAITS: readonly ["specialist-panel-capable", "debate-capable", "ranked-voting-capable"];
|
|
10
10
|
/**
|
|
11
11
|
* The default-eligible kinds, each carrying all three consensus traits. A deployment
|
|
12
|
-
* can extend this by assigning them to more kinds. NOTE:
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* can extend this by assigning them to more kinds. NOTE: several of these run in a
|
|
13
|
+
* container against a real checkout in their standard mode; in CONSENSUS mode they reason
|
|
14
|
+
* inline over the provided context rather than exploring the checkout — a deliberate trade
|
|
15
|
+
* made worthwhile by the gating, which only triggers consensus for high-complexity/risk/impact
|
|
16
|
+
* tasks.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* REVIEW kinds are the highest-value users of the mechanism — a review is a JUDGEMENT, which
|
|
19
|
+
* is exactly what a panel of independent models is better at than one model — but what a panel
|
|
20
|
+
* can see differs by kind, and that is what decides whether a kind belongs here:
|
|
21
|
+
*
|
|
22
|
+
* - `pr-reviewer` reads its whole input from backend-prepared context files (the computed
|
|
23
|
+
* diff, the PR's existing review threads, the standards). Those bodies are folded into an
|
|
24
|
+
* inline prompt by `userPromptFor`, so a panel reviews the SAME material the container
|
|
25
|
+
* reviewer would.
|
|
26
|
+
* - `reviewer` / `doc-reviewer` explore a read-only checkout in their standard mode. A panel
|
|
27
|
+
* reasons over the producer's reported output and the prior steps instead — strictly less
|
|
28
|
+
* than the container sees, so consensus here trades ground-truth depth for judgement
|
|
29
|
+
* diversity. That is why it is opt-in per step and gated on the estimate.
|
|
30
|
+
* - `architect-companion` / `spec-companion` are INLINE companions already: the artifact they
|
|
31
|
+
* grade IS the producer's reported text, so a panel loses nothing at all.
|
|
32
|
+
*
|
|
33
|
+
* Full list:
|
|
34
|
+
* - architect → a well-reasoned architecture document
|
|
35
|
+
* - analysis → a deep investigation / aggregate of observations
|
|
36
|
+
* - reviewer → a rigorous, high-confidence code review (the companion verdict)
|
|
37
|
+
* - pr-reviewer → a deep review of an existing pull request
|
|
38
|
+
* - doc-reviewer → the document companion's verdict on a drafted document
|
|
39
|
+
* - architect-companion → the design companion's verdict on an architecture proposal
|
|
40
|
+
* - spec-companion → the spec companion's verdict on a specification increment
|
|
41
|
+
* - task-estimator → an accurate complexity/risk/impact estimate (ranked-scoring)
|
|
22
42
|
*/
|
|
23
43
|
export declare const DEFAULT_CONSENSUS_ELIGIBLE_KINDS: AgentKind[];
|
|
24
44
|
/**
|
package/dist/traits.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAU5D,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,cAAc,mBAAmB,CAAA;AAC9C,eAAO,MAAM,qBAAqB,0BAA0B,CAAA;AAE5D,8DAA8D;AAC9D,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAI5D,CAAA;AAED,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,kFAInB,CAAA;AAEV
|
|
1
|
+
{"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAU5D,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,cAAc,mBAAmB,CAAA;AAC9C,eAAO,MAAM,qBAAqB,0BAA0B,CAAA;AAE5D,8DAA8D;AAC9D,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAI5D,CAAA;AAED,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,kFAInB,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gCAAgC,EAAE,SAAS,EASvD,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,GAAE,SAAS,EAAqC,GACpD,IAAI,CAGN;AAED,gFAAgF;AAChF,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB,EAAE,CAKrB;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAEzF"}
|
package/dist/traits.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { traitsFor } from '@cat-factory/agents';
|
|
2
|
-
import { TASK_ESTIMATOR_AGENT_KIND } from '@cat-factory/agents';
|
|
2
|
+
import { PR_REVIEWER_KIND, TASK_ESTIMATOR_AGENT_KIND } from '@cat-factory/agents';
|
|
3
3
|
// The group of consensus CAPABILITY traits an agent kind can carry. Each marks the
|
|
4
4
|
// kind eligible for one consensus strategy: when a step's kind carries the trait, the
|
|
5
5
|
// pipeline builder offers that strategy under "Enable Consensus". They are pure marker
|
|
@@ -22,21 +22,45 @@ export const CONSENSUS_TRAITS = [
|
|
|
22
22
|
];
|
|
23
23
|
/**
|
|
24
24
|
* The default-eligible kinds, each carrying all three consensus traits. A deployment
|
|
25
|
-
* can extend this by assigning them to more kinds. NOTE:
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
25
|
+
* can extend this by assigning them to more kinds. NOTE: several of these run in a
|
|
26
|
+
* container against a real checkout in their standard mode; in CONSENSUS mode they reason
|
|
27
|
+
* inline over the provided context rather than exploring the checkout — a deliberate trade
|
|
28
|
+
* made worthwhile by the gating, which only triggers consensus for high-complexity/risk/impact
|
|
29
|
+
* tasks.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* REVIEW kinds are the highest-value users of the mechanism — a review is a JUDGEMENT, which
|
|
32
|
+
* is exactly what a panel of independent models is better at than one model — but what a panel
|
|
33
|
+
* can see differs by kind, and that is what decides whether a kind belongs here:
|
|
34
|
+
*
|
|
35
|
+
* - `pr-reviewer` reads its whole input from backend-prepared context files (the computed
|
|
36
|
+
* diff, the PR's existing review threads, the standards). Those bodies are folded into an
|
|
37
|
+
* inline prompt by `userPromptFor`, so a panel reviews the SAME material the container
|
|
38
|
+
* reviewer would.
|
|
39
|
+
* - `reviewer` / `doc-reviewer` explore a read-only checkout in their standard mode. A panel
|
|
40
|
+
* reasons over the producer's reported output and the prior steps instead — strictly less
|
|
41
|
+
* than the container sees, so consensus here trades ground-truth depth for judgement
|
|
42
|
+
* diversity. That is why it is opt-in per step and gated on the estimate.
|
|
43
|
+
* - `architect-companion` / `spec-companion` are INLINE companions already: the artifact they
|
|
44
|
+
* grade IS the producer's reported text, so a panel loses nothing at all.
|
|
45
|
+
*
|
|
46
|
+
* Full list:
|
|
47
|
+
* - architect → a well-reasoned architecture document
|
|
48
|
+
* - analysis → a deep investigation / aggregate of observations
|
|
49
|
+
* - reviewer → a rigorous, high-confidence code review (the companion verdict)
|
|
50
|
+
* - pr-reviewer → a deep review of an existing pull request
|
|
51
|
+
* - doc-reviewer → the document companion's verdict on a drafted document
|
|
52
|
+
* - architect-companion → the design companion's verdict on an architecture proposal
|
|
53
|
+
* - spec-companion → the spec companion's verdict on a specification increment
|
|
54
|
+
* - task-estimator → an accurate complexity/risk/impact estimate (ranked-scoring)
|
|
35
55
|
*/
|
|
36
56
|
export const DEFAULT_CONSENSUS_ELIGIBLE_KINDS = [
|
|
37
57
|
'architect',
|
|
38
58
|
'analysis',
|
|
39
59
|
'reviewer',
|
|
60
|
+
PR_REVIEWER_KIND,
|
|
61
|
+
'doc-reviewer',
|
|
62
|
+
'architect-companion',
|
|
63
|
+
'spec-companion',
|
|
40
64
|
TASK_ESTIMATOR_AGENT_KIND,
|
|
41
65
|
];
|
|
42
66
|
/**
|
package/dist/traits.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.js","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"traits.js","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAEjF,mFAAmF;AACnF,sFAAsF;AACtF,uFAAuF;AACvF,kFAAkF;AAClF,qFAAqF;AAErF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ED,sEAAsE;AACtE,MAAM,UAAU,mBAAmB,CAAC,IAAe,EAAE,QAA2B;IAC9E,OAAO,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;AAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/consensus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Optional consensus-orchestration mechanism (specialist panel / debate / ranked voting) for cat-factory agent steps, with task-estimate gating.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ai": "^7.0.37",
|
|
28
|
-
"@cat-factory/agents": "0.
|
|
29
|
-
"@cat-factory/contracts": "0.
|
|
30
|
-
"@cat-factory/kernel": "0.
|
|
28
|
+
"@cat-factory/agents": "0.87.0",
|
|
29
|
+
"@cat-factory/contracts": "0.195.0",
|
|
30
|
+
"@cat-factory/kernel": "0.191.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"typescript": "7.0.2",
|