@productbrain/mcp 0.0.1-beta.4039 → 0.0.1-beta.4051

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.
@@ -8493,7 +8493,7 @@ function buildTaskAlignmentLines(ta) {
8493
8493
  lines.push(`${i + 1}. **${ta.escapeRoutes[i].kind}** \u2014 ${ta.escapeRoutes[i].instruction}`);
8494
8494
  }
8495
8495
  }
8496
- if (ta.verdict === "misaligned" && ta.citedRule) {
8496
+ if ((ta.verdict === "misaligned" || ta.verdict === "abstain") && ta.citedRule) {
8497
8497
  lines.push("");
8498
8498
  lines.push(`_Workspace rule: \`${ta.citedRule.entryId ?? ""}\` ${ta.citedRule.name}._`);
8499
8499
  }
@@ -8772,6 +8772,18 @@ function reportOrientWrapperBytes(toolResult, truncated, tier, taskProvided) {
8772
8772
  }
8773
8773
  }
8774
8774
 
8775
+ // src/tools/orientDegradation.ts
8776
+ function buildDegradedPreloadsLine(degraded) {
8777
+ if (!degraded || degraded.length === 0) return null;
8778
+ return `\u26A0\uFE0F Degraded this run: ${degraded.join(", ")} preload(s) failed open \u2014 results may be thinner than usual.`;
8779
+ }
8780
+ function coherencyCheckTag(status2) {
8781
+ if (status2 === "not_checked") return " [not checked]";
8782
+ if (status2 === "check_incomplete") return " [check incomplete]";
8783
+ if (status2 === "stale") return " [stale \u2014 entry changed since last check]";
8784
+ return "";
8785
+ }
8786
+
8775
8787
  // src/lib/gapToPrompt.ts
8776
8788
  function cleanLabel(label) {
8777
8789
  return label.replace(/ has entries$/i, "").replace(/ coverage$/i, "").replace(/^Strategy — /i, "");
@@ -9385,12 +9397,6 @@ var ORIENT_ACTION_SPECS = {
9385
9397
  description: "All three fields are required."
9386
9398
  }
9387
9399
  };
9388
- function coherencyCheckTag(status2) {
9389
- if (status2 === "not_checked") return " [not checked]";
9390
- if (status2 === "check_incomplete") return " [check incomplete]";
9391
- if (status2 === "stale") return " [stale \u2014 entry changed since last check]";
9392
- return "";
9393
- }
9394
9400
  function taskGroundingWarningLines(task, hasTaskGrounding = false) {
9395
9401
  if (hasTaskGrounding) return [];
9396
9402
  if (task) {
@@ -9609,6 +9615,8 @@ async function _handleOrient({ mode = "full", tier, task, scope, startupSignals,
9609
9615
  if (orientView?.taskAlignment) {
9610
9616
  lines.push(`Task alignment: ${orientView.taskAlignment.verdict} \u2014 ${orientView.taskAlignment.wording.replace(/\*\*/g, "")}`);
9611
9617
  }
9618
+ const degradedLineBrief = buildDegradedPreloadsLine(orientView?.degradedPreloads);
9619
+ if (degradedLineBrief) lines.push(degradedLineBrief);
9612
9620
  lines.push(...buildRitualsSurfaceLines(orientView, { fetchFailed: orientFetchFailed || orientView?.fetchFailed === true }));
9613
9621
  if (orientView?.startup?.domainRetrieval) {
9614
9622
  const retrieval = orientView.startup.domainRetrieval;
@@ -9752,6 +9760,8 @@ async function _handleOrient({ mode = "full", tier, task, scope, startupSignals,
9752
9760
  ...orientView?.taskContext?.isGroundingStub ? { groundingStub: true } : {},
9753
9761
  // WP-465 slice ③ (§4.1): served verbatim — identical on CLI and MCP.
9754
9762
  ...orientView?.taskAlignment ? { taskAlignment: orientView.taskAlignment } : {},
9763
+ ...orientView?.degradedPreloads?.length ? { degradedPreloads: orientView.degradedPreloads } : {},
9764
+ // WP-621 S1
9755
9765
  // WP-582 B2 round 1 (Codex P2 review, PR #532, T1): omit when `undefined` (old
9756
9766
  // deploy, field never served); keep an explicit `null` for the documented no-row
9757
9767
  // arm — the two states must stay distinguishable to a structuredContent consumer.
@@ -9944,6 +9954,8 @@ async function _handleOrient({ mode = "full", tier, task, scope, startupSignals,
9944
9954
  }
9945
9955
  if (orientView) {
9946
9956
  lines.push(...buildTaskAlignmentLines(orientView.taskAlignment));
9957
+ const degradedLineFull = buildDegradedPreloadsLine(orientView.degradedPreloads);
9958
+ if (degradedLineFull) lines.push(degradedLineFull);
9947
9959
  lines.push(...buildRitualsSurfaceLines(orientView, { fetchFailed: orientFetchFailed || orientView?.fetchFailed === true }));
9948
9960
  lines.push(...formatInitiativeStatusLines(orientView.initiativeStatus));
9949
9961
  lines.push(...formatWorkstreamHealthLines(orientView.workstreamHealth));
@@ -10004,7 +10016,7 @@ async function _handleOrient({ mode = "full", tier, task, scope, startupSignals,
10004
10016
  lines.push("## Strategy highlights");
10005
10017
  lines.push("_One-sentence strategy, positioning, moat, business model, GTM \u2014 high-level strategic context._");
10006
10018
  lines.push("");
10007
- fullStrategyHighlights.forEach((e) => lines.push(fmt(e)));
10019
+ fullStrategyHighlights.forEach((e) => lines.push(fmt(e) + (e.preview ? ` \u2014 ${e.preview}` : "")));
10008
10020
  lines.push("");
10009
10021
  }
10010
10022
  const fullPlayingField = orientView.playingField ?? [];
@@ -10196,6 +10208,8 @@ async function _handleOrient({ mode = "full", tier, task, scope, startupSignals,
10196
10208
  ...orientView?.taskContext?.isGroundingStub ? { groundingStub: true } : {},
10197
10209
  // WP-465 slice ③ (§4.1): served verbatim — identical on CLI and MCP.
10198
10210
  ...orientView?.taskAlignment ? { taskAlignment: orientView.taskAlignment } : {},
10211
+ ...orientView?.degradedPreloads?.length ? { degradedPreloads: orientView.degradedPreloads } : {},
10212
+ // WP-621 S1
10199
10213
  // WP-582 B2 round 1 (Codex P2 review, PR #532, T1): served verbatim ONLY when the
10200
10214
  // server actually sent the field — see the matching brief-mode comment above for the
10201
10215
  // undefined-vs-null distinction this preserves.
@@ -10215,7 +10229,9 @@ async function _handleOrient({ mode = "full", tier, task, scope, startupSignals,
10215
10229
  ...orientView?._budget ? { _budget: orientView._budget } : {},
10216
10230
  // WP-560/TEN-2532 post-merge review (Codex P2): the rendered shape-advisory
10217
10231
  // line must reach structuredContent too, not just the text.
10218
- ...orientView?.shapeAdvisorySummary ? { shapeAdvisorySummary: orientView.shapeAdvisorySummary } : {}
10232
+ ...orientView?.shapeAdvisorySummary ? { shapeAdvisorySummary: orientView.shapeAdvisorySummary } : {},
10233
+ // WP-622 (Copilot review PR #601 P2): was dropped from the full-mode machine payload.
10234
+ ...orientView?.strategyHighlights?.length ? { strategyHighlights: orientView.strategyHighlights } : {}
10219
10235
  }
10220
10236
  )
10221
10237
  };
@@ -16702,4 +16718,4 @@ export {
16702
16718
  createProductBrainServer,
16703
16719
  initFeatureFlags
16704
16720
  };
16705
- //# sourceMappingURL=chunk-4SY3XNA2.js.map
16721
+ //# sourceMappingURL=chunk-UCDIJ2OA.js.map