deliberate-cli 0.2.0-beta.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +40 -0
- package/LICENSE +174 -0
- package/README.md +89 -0
- package/package.json +51 -0
- package/roles/analyst/frame/instructions.md +88 -0
- package/roles/analyst/frame/output-template.md +52 -0
- package/roles/analyst/launch/instructions.md +63 -0
- package/roles/analyst/launch/output-template.md +50 -0
- package/roles/analyst/one-pager/instructions.md +75 -0
- package/roles/analyst/one-pager/output-template.md +38 -0
- package/roles/analyst/shape/instructions.md +63 -0
- package/roles/analyst/shape/output-template.md +52 -0
- package/roles/briefer/brief/instructions.md +77 -0
- package/roles/briefer/brief/output-template.md +37 -0
- package/roles/config.yaml +130 -0
- package/roles/evaluator/score/instructions.md +84 -0
- package/roles/evaluator/score/output-template.md +11 -0
- package/roles/initiator/init/instructions.md +111 -0
- package/roles/initiator/init/output-template-competitors.md +16 -0
- package/roles/initiator/init/output-template-ecosystem.md +19 -0
- package/roles/initiator/init/output-template-product.md +136 -0
- package/roles/prototyper/prototype/instructions.md +146 -0
- package/roles/prototyper/prototype/output-template.md +10 -0
- package/roles/reporter/readout/instructions.md +54 -0
- package/roles/reporter/readout/output-template.md +37 -0
- package/roles/scout/matchup/instructions.md +74 -0
- package/roles/scout/matchup/output-template.md +115 -0
- package/roles/skills/README.md +19 -0
- package/roles/skills/critique.md +64 -0
- package/roles/skills/head-to-head.md +88 -0
- package/roles/skills/jtbd.md +43 -0
- package/roles/skills/landscape-scan.md +77 -0
- package/roles/skills/metrics.md +58 -0
- package/roles/skills/positioning.md +44 -0
- package/roles/skills/prioritization.md +101 -0
- package/roles/skills/product-readout.md +98 -0
- package/roles/skills/tech-constraints.md +27 -0
- package/roles/skills/ux-principles.md +24 -0
- package/roles/skills/win-conditions.md +68 -0
- package/skill/SKILL.md +231 -0
- package/skill/scripts/deliberate.mjs +44 -0
- package/src/cli/deliberate.mjs +628 -0
- package/src/engine/app-boot.mjs +17 -0
- package/src/engine/briefs.mjs +101 -0
- package/src/engine/cases.mjs +17 -0
- package/src/engine/commands.mjs +75 -0
- package/src/engine/init.mjs +34 -0
- package/src/engine/layout.mjs +37 -0
- package/src/engine/log.mjs +22 -0
- package/src/engine/matchups.mjs +87 -0
- package/src/engine/onepager.mjs +51 -0
- package/src/engine/pipeline.mjs +134 -0
- package/src/engine/projects.mjs +17 -0
- package/src/engine/prompts.mjs +28 -0
- package/src/engine/prototype.mjs +86 -0
- package/src/engine/readout-charts.mjs +217 -0
- package/src/engine/readouts.mjs +132 -0
- package/src/engine/roles.mjs +137 -0
- package/src/engine/scaffold.mjs +54 -0
- package/src/engine/score.mjs +66 -0
- package/src/engine/service.mjs +18 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* score.mjs — the Score: the decorrelated Evaluator's go/no-go verdict for a case, a
|
|
3
|
+
* recomputable companion to the decision record (analysis.md), NOT a funnel stage.
|
|
4
|
+
*
|
|
5
|
+
* The Evaluator is the ONE isolated, cross-vendor sub-agent (model-decorrelated from the
|
|
6
|
+
* in-session Analyst): it reads the current case record and returns a scored verdict. The
|
|
7
|
+
* score is deliberately decoupled from the funnel — its own `score.md` artifact — so a
|
|
8
|
+
* revised analysis can be re-scored on demand (`deliberate case score`) without rewriting
|
|
9
|
+
* the record. `EVALUATOR_STAGE` is the config key (roles/config.yaml) it resolves under.
|
|
10
|
+
*
|
|
11
|
+
* Like the Briefer/One-pager, the engine here is LLM-free: it assembles the producer
|
|
12
|
+
* prompt (grounding + skills + instructions + the accumulated case record) and
|
|
13
|
+
* deterministically persists what the host produces as
|
|
14
|
+
* `deliberate/cases/<case>/score.md`, beside analysis.md, stamping the go/no-go number
|
|
15
|
+
* onto the record. The decision record links to it (a "## Score" section) once it exists.
|
|
16
|
+
*/
|
|
17
|
+
import { EVALUATOR_STAGE } from 'sonorance/plugins/deliberate/stages.mjs';
|
|
18
|
+
import { agentConfig } from './roles.mjs';
|
|
19
|
+
import { read, loadBody, loadSkills } from './prompts.mjs';
|
|
20
|
+
import { projectContext, caseContext, cleanArtifact, scoreOf } from './pipeline.mjs';
|
|
21
|
+
import { unwrapProse } from 'sonorance/plugins/deliberate/markdown.mjs';
|
|
22
|
+
|
|
23
|
+
// The config key (roles/config.yaml) + role folder for the Evaluator's score sub-job.
|
|
24
|
+
// It IS the EVALUATOR_STAGE, but never enters the funnel state machine (STAGES) — the
|
|
25
|
+
// score is a standalone, recomputable artifact (like ONEPAGER_STAGE / BRIEF_STAGE).
|
|
26
|
+
export const SCORE_STAGE = EVALUATOR_STAGE;
|
|
27
|
+
|
|
28
|
+
// The exact producer prompt for a case's Score: grounding + the evaluator skills + the
|
|
29
|
+
// scoring instructions (system) and the accumulated case record it must judge (user).
|
|
30
|
+
// The in-harness skill hands this to an ISOLATED, cross-vendor sub-agent — decorrelated
|
|
31
|
+
// from the Analyst — which returns the scored verdict.
|
|
32
|
+
export async function scorePrompt(store, project, kase) {
|
|
33
|
+
const cfg = agentConfig(SCORE_STAGE);
|
|
34
|
+
const instruction = await loadBody(cfg.instructions);
|
|
35
|
+
const agents = await read('AGENTS.md');
|
|
36
|
+
const template = await read(cfg.templates.default);
|
|
37
|
+
const skillsBlock = (await loadSkills(cfg.skills)) || '(none)';
|
|
38
|
+
const pctx = projectContext(store, project);
|
|
39
|
+
const system = `${agents}\n\n${pctx}\n\n## Skills\n${skillsBlock}\n\n## Stage instructions\n${instruction}`;
|
|
40
|
+
const ctx = caseContext(store, kase);
|
|
41
|
+
const tpl = template
|
|
42
|
+
? `\n\n----- OUTPUT TEMPLATE -----\n(Fill EVERY section with real, grounded content drawn ONLY from the record below. The italic _..._ lines and parentheticals are guidance for you — replace them; never echo the template's guidance text, and do not add a "grounding"/"notes"/"assumptions" section.)\n${template}`
|
|
43
|
+
: '';
|
|
44
|
+
const user = `Case record to evaluate (score ONLY this — introduce no new claims or evidence):\n${ctx}\nProduce the score.${tpl}`;
|
|
45
|
+
return { system, user, template, model: cfg.model };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Persist a produced Score (LLM-free): clean it, unwrap hard-wrapped prose, extract the
|
|
49
|
+
// go/no-go number, and write it to `score.md` beside the record (the store also stamps the
|
|
50
|
+
// number and evaluator provenance onto the record + refreshes its link). Shared by the
|
|
51
|
+
// engine and `case score save`.
|
|
52
|
+
export async function persistScore(store, project, kase, rawArtifact, provenance) {
|
|
53
|
+
const model = String(provenance?.model || '').trim();
|
|
54
|
+
if (!/^[A-Za-z0-9._:/-]{1,100}$/.test(model)) {
|
|
55
|
+
throw new Error('Score provenance requires a valid evaluator model id');
|
|
56
|
+
}
|
|
57
|
+
if (typeof provenance?.independent !== 'boolean') {
|
|
58
|
+
throw new Error('Score provenance requires an independence status');
|
|
59
|
+
}
|
|
60
|
+
const cfg = agentConfig(SCORE_STAGE);
|
|
61
|
+
const template = await read(cfg.templates.default);
|
|
62
|
+
const body = unwrapProse(cleanArtifact(rawArtifact, template));
|
|
63
|
+
const number = scoreOf(body);
|
|
64
|
+
store.writeScore(kase.id, body, number, { model, independent: provenance.independent });
|
|
65
|
+
return { case: store.getCase(kase.id), score: number, file: store.scoreRef(kase.id) };
|
|
66
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* service.mjs — public facade for the engine's high-level operations, used by the
|
|
3
|
+
* CLI. Split across focused modules (projects / cases) plus the pipeline engine;
|
|
4
|
+
* this barrel keeps a single, stable import surface so callers don't depend on the
|
|
5
|
+
* layout. Context derivation is host-driven now (the harness writes deliberate/context/product.md), so
|
|
6
|
+
* there is no engine `computeContext`; titling is likewise the host's job.
|
|
7
|
+
*/
|
|
8
|
+
export { setCurrentProject, openProjectVault } from './projects.mjs';
|
|
9
|
+
export { caseDetail } from './cases.mjs';
|
|
10
|
+
export { projectContext, stagePrompt, persistStage } from './pipeline.mjs';
|
|
11
|
+
export { onepagerPrompt, persistOnepager, ONEPAGER_STAGE } from './onepager.mjs';
|
|
12
|
+
export { scorePrompt, persistScore, SCORE_STAGE } from './score.mjs';
|
|
13
|
+
export { prototypePrompt, persistPrototype, PROTO_STAGE } from './prototype.mjs';
|
|
14
|
+
export { briefWindow, briefPrompt, persistBrief, briefPeriodLabel, BRIEF_STAGE } from './briefs.mjs';
|
|
15
|
+
export { readoutPeriod, readoutPrompt, persistReadout, readoutPeriodLabel, READOUT_STAGE } from './readouts.mjs';
|
|
16
|
+
export { normalizeTrendChartSpec, renderTrendChart, renderTrendChartFile, loadReadoutCharts } from './readout-charts.mjs';
|
|
17
|
+
export { matchupPrompt, persistMatchup, matchupAsOfLabel, MATCHUP_STAGE } from './matchups.mjs';
|
|
18
|
+
export { initPrompt, INIT_STAGE } from './init.mjs';
|