@productbrain/mcp 0.0.1-beta.8818 → 0.0.1-beta.8827

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.
@@ -1156,6 +1156,32 @@ function buildCaptureForRealNextAction(payload) {
1156
1156
  }];
1157
1157
  }
1158
1158
 
1159
+ // src/lib/checklist.ts
1160
+ var CHECKLIST_LINES = {
1161
+ strategy: {
1162
+ coherent_narrative: "Connect the diagnosis, the policy and the first actions (40+ words)",
1163
+ decisiveness: "Say what you will not do",
1164
+ time_bounded: "Name a horizon: a date, a duration or a milestone"
1165
+ },
1166
+ vision: {
1167
+ specificity: "Say what will be different, in words only this product could use (15+ words)",
1168
+ beneficiary: "Name who benefits: a role, a persona or a segment",
1169
+ falsifiability: "Choose a direction a reasonable rival would reject",
1170
+ stranger_test: "Explain it so a stranger knows what you build (20+ words)"
1171
+ }
1172
+ };
1173
+ var MARK = { met: "[x]", not_yet: "[ ]", judging: "[~]" };
1174
+ function renderChecklist(canonicalKey, criteria, judging) {
1175
+ const lines = CHECKLIST_LINES[canonicalKey];
1176
+ if (!lines) return null;
1177
+ return criteria.filter((c) => lines[c.id] !== void 0).map((c) => {
1178
+ const state = !c.passed ? "not_yet" : judging ? "judging" : "met";
1179
+ const still = state === "judging" ? " (still judging)" : "";
1180
+ const missing = state === "not_yet" && c.missing ? ` \u2014 missing: ${c.missing}` : "";
1181
+ return `${MARK[state]} ${lines[c.id]}${still}${missing}`;
1182
+ });
1183
+ }
1184
+
1159
1185
  // src/lib/rubricFormatting.ts
1160
1186
  function verdictQualityPhrase(result2) {
1161
1187
  const v = result2?.verdict;
@@ -1174,7 +1200,10 @@ function formatRubricCoaching(result2) {
1174
1200
  const failed = (verdict.criteria ?? []).filter((c) => !c.passed);
1175
1201
  const total = verdict.criteria?.length ?? 0;
1176
1202
  const passedCount = total - failed.length;
1177
- if (verdict.passed) {
1203
+ const checklist = renderChecklist(verdict.canonicalKey, verdict.criteria, result2.source !== "llm");
1204
+ if (checklist) {
1205
+ lines.push(`Quality checklist for \`${verdict.canonicalKey}\`:`, "", ...checklist);
1206
+ } else if (verdict.passed) {
1178
1207
  lines.push(`All ${total} rubric criteria pass for \`${verdict.canonicalKey}\` (${verdict.tier} tier).`);
1179
1208
  } else {
1180
1209
  lines.push(`${passedCount}/${total} criteria pass for \`${verdict.canonicalKey}\` (${verdict.tier} tier)`);
@@ -1194,9 +1223,9 @@ function formatRubricCoaching(result2) {
1194
1223
  lines.push("");
1195
1224
  lines.push("### Roger Martin Test");
1196
1225
  if (rogerMartin.isStrategicChoice) {
1197
- lines.push("This principle passes \u2014 the opposite is a reasonable strategic choice.");
1226
+ lines.push("This passes \u2014 the opposite is a reasonable strategic choice.");
1198
1227
  } else {
1199
- lines.push(`This principle may not be a strategic choice. ${rogerMartin.reasoning}`);
1228
+ lines.push(`This may not be a strategic choice. ${rogerMartin.reasoning}`);
1200
1229
  if (rogerMartin.suggestion) {
1201
1230
  lines.push(`_Suggestion:_ ${rogerMartin.suggestion}`);
1202
1231
  }
@@ -1212,7 +1241,10 @@ function formatRubricVerdictSection(verdict) {
1212
1241
  const passedCount = total - failed.length;
1213
1242
  const durationSuffix = verdict.llmDurationMs ? ` in ${(verdict.llmDurationMs / 1e3).toFixed(1)}s` : "";
1214
1243
  const statusNote = verdict.llmStatus === "pending" ? " \u2014 LLM evaluation in progress..." : verdict.llmStatus === "failed" ? ` \u2014 LLM evaluation failed${verdict.llmError ? `: ${verdict.llmError}` : ""}, showing heuristic results` : verdict.source === "llm" && durationSuffix ? ` \u2014 evaluated${durationSuffix}` : "";
1215
- if (failed.length === 0) {
1244
+ const checklist = renderChecklist(verdict.canonicalKey, verdict.criteria, verdict.llmStatus === "pending");
1245
+ if (checklist) {
1246
+ lines.push(`Quality checklist for \`${verdict.canonicalKey}\` (${verdict.source} evaluation)${statusNote}:`, "", ...checklist);
1247
+ } else if (failed.length === 0) {
1216
1248
  lines.push(`All ${total} rubric criteria pass for \`${verdict.canonicalKey}\` (${verdict.tier} tier, ${verdict.source} evaluation).${statusNote}`);
1217
1249
  } else {
1218
1250
  lines.push(`${passedCount}/${total} criteria pass for \`${verdict.canonicalKey}\` (${verdict.tier} tier, ${verdict.source} evaluation)${statusNote}`);
@@ -10468,15 +10500,17 @@ Entry \`${entryId}\` not found. Use \`search\` to find the right ID.`,
10468
10500
  }
10469
10501
  const criteria = verdict.criteria ?? [];
10470
10502
  const lines = [`# Quality Check: ${entryId}`, ""];
10471
- const staleWhy = res.staleReason === "methodology_changed_since_judged" ? "the rubric changed since it was judged" : "the entry was edited since it was judged";
10503
+ const staleWhy = res.staleReason === "rubric_removed" ? "this entry type is no longer graded" : res.staleReason === "methodology_changed_since_judged" ? "the rubric changed since it was judged" : "the entry was edited since it was judged";
10472
10504
  if (res.stale) {
10473
10505
  lines.push(
10474
10506
  `> STALE \u2014 this verdict for \`${entryId}\` no longer counts: ${staleWhy}. Run \`quality action=re-evaluate entryId="${entryId}"\` for a current verdict.`,
10475
10507
  ""
10476
10508
  );
10477
10509
  }
10478
- const verdictSection = formatRubricVerdictSection(verdict);
10479
- lines.push(verdictSection || `Verdict tier \`${verdict.tier ?? "unknown"}\` for \`${entryId}\` \u2014 no rubric criteria to report.`);
10510
+ if (!res.stale) {
10511
+ const verdictSection = formatRubricVerdictSection(verdict);
10512
+ lines.push(verdictSection || `Verdict tier \`${verdict.tier ?? "unknown"}\` for \`${entryId}\` \u2014 no rubric criteria to report.`);
10513
+ }
10480
10514
  await appendLinkSuggestions(entryId, lines);
10481
10515
  try {
10482
10516
  const wsForTracking = await getWorkspaceContext();
@@ -10496,15 +10530,15 @@ Entry \`${entryId}\` not found. Use \`search\` to find the right ID.`,
10496
10530
  const passedCount = criteria.filter((c) => c.passed).length;
10497
10531
  return successResult(
10498
10532
  lines.join("\n"),
10499
- `Quality check for ${entryId}: ${verdict.tier ?? "unknown"} tier, ${passedCount}/${criteria.length} criteria pass.` + (res.stale ? ` STALE \u2014 ${staleWhy}; re-evaluate for a current one.` : ""),
10533
+ res.stale ? `Quality check for ${entryId}: STALE \u2014 ${staleWhy}; re-evaluate for a current one.` : `Quality check for ${entryId}: ${verdict.tier ?? "unknown"} tier, ${passedCount}/${criteria.length} criteria pass.`,
10500
10534
  {
10501
10535
  entryId,
10502
10536
  entryFound: true,
10503
10537
  hasVerdict: true,
10504
10538
  stale: res.stale ?? false,
10505
10539
  tier: verdict.tier,
10506
- passed: verdict.passed,
10507
- criteria: criteria.map((c) => ({ id: c.id, passed: c.passed, hint: c.hint }))
10540
+ ...res.stale ? {} : { passed: verdict.passed },
10541
+ criteria: res.stale ? [] : criteria.map((c) => ({ id: c.id, passed: c.passed, hint: c.hint }))
10508
10542
  },
10509
10543
  [
10510
10544
  { tool: "relations", description: "Suggest connections", parameters: { action: "suggest", entryId } }
@@ -13903,4 +13937,4 @@ export {
13903
13937
  createProductBrainServer,
13904
13938
  initFeatureFlags
13905
13939
  };
13906
- //# sourceMappingURL=chunk-JCENVG5F.js.map
13940
+ //# sourceMappingURL=chunk-ASADQLRX.js.map