@productbrain/mcp 0.0.1-beta.1828 → 0.0.1-beta.1838
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.
|
@@ -12072,6 +12072,27 @@ function replaceVocabTokens(body, workspaceCtx, collectionCtxMap) {
|
|
|
12072
12072
|
|
|
12073
12073
|
// src/tools/orient.ts
|
|
12074
12074
|
var PURPOSE_GAP_PREFIX = "purpose-gap-";
|
|
12075
|
+
function formatRetrievalMissLines(verdict, domain) {
|
|
12076
|
+
const lines = [];
|
|
12077
|
+
if (verdict.served !== "ok") {
|
|
12078
|
+
if (verdict.served === "miss") {
|
|
12079
|
+
lines.push(`\u26A0 RETRIEVAL MISS \u2014 ${verdict.kind ?? "unknown"}`);
|
|
12080
|
+
} else {
|
|
12081
|
+
lines.push(`\xB7 weak serve (provisional, ${verdict.rubricVersion}): ${verdict.kind ?? "thin"}`);
|
|
12082
|
+
}
|
|
12083
|
+
}
|
|
12084
|
+
if (domain?.reason) lines.push(` Reason: ${domain.reason}`);
|
|
12085
|
+
if (domain?.nextAction) lines.push(` Next action: ${domain.nextAction}`);
|
|
12086
|
+
if (domain?.evidenceGap) lines.push(` Evidence gap: ${domain.evidenceGap}`);
|
|
12087
|
+
return lines;
|
|
12088
|
+
}
|
|
12089
|
+
function domainDetailFromRetrieval(retrieval) {
|
|
12090
|
+
if (!retrieval) return null;
|
|
12091
|
+
const reason = typeof retrieval.fallbackReason === "string" ? retrieval.fallbackReason : null;
|
|
12092
|
+
const nextAction = typeof retrieval.fallbackAction === "string" ? retrieval.fallbackAction : null;
|
|
12093
|
+
const evidenceGap = typeof retrieval.evidenceGap === "string" ? retrieval.evidenceGap : null;
|
|
12094
|
+
return reason || nextAction || evidenceGap ? { reason, nextAction, evidenceGap } : null;
|
|
12095
|
+
}
|
|
12075
12096
|
var NON_MEANINGFUL_TASK_RE = /^[\s]*$/u;
|
|
12076
12097
|
function taskIsMeaningful(task) {
|
|
12077
12098
|
if (typeof task !== "string") return false;
|
|
@@ -12274,6 +12295,14 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12274
12295
|
}
|
|
12275
12296
|
lines.push("");
|
|
12276
12297
|
lines.push(...taskGroundingWarningLines(task, hasTaskGrounding));
|
|
12298
|
+
const retrievalMissLines = orientView?.retrievalMiss ? formatRetrievalMissLines(
|
|
12299
|
+
orientView.retrievalMiss,
|
|
12300
|
+
domainDetailFromRetrieval(orientView.startup?.domainRetrieval)
|
|
12301
|
+
) : [];
|
|
12302
|
+
if (retrievalMissLines.length > 0) {
|
|
12303
|
+
lines.push(...retrievalMissLines);
|
|
12304
|
+
lines.push("");
|
|
12305
|
+
}
|
|
12277
12306
|
if (mode === "brief") {
|
|
12278
12307
|
const briefStage = readiness?.stage ?? (readiness?.score != null ? readiness.score < 50 ? "seeded" : "grounded" : "unknown");
|
|
12279
12308
|
lines.push(`Brain stage: ${briefStage}`);
|
|
@@ -12304,9 +12333,6 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12304
12333
|
const scopedTo = retrieval.resolvedDomainSlug ? ` (${retrieval.resolvedDomainSlug})` : "";
|
|
12305
12334
|
lines.push(`Domain retrieval: ${retrieval.state}${scopedTo}`);
|
|
12306
12335
|
if (retrieval.activeSource) lines.push(`Active source: ${retrieval.activeSource}`);
|
|
12307
|
-
if (retrieval.fallbackReason) lines.push(`Fallback: ${retrieval.fallbackReason}`);
|
|
12308
|
-
if (retrieval.fallbackAction) lines.push(`Action: ${retrieval.fallbackAction}`);
|
|
12309
|
-
if (retrieval.evidenceGap) lines.push(`Evidence gap: ${retrieval.evidenceGap}`);
|
|
12310
12336
|
if (retrieval.directRatifiedCount != null || retrieval.inheritedRatifiedCount != null || retrieval.orgFallbackCount != null) {
|
|
12311
12337
|
lines.push(`Domain relation evidence: ${retrieval.directRatifiedCount ?? 0} direct, ${retrieval.inheritedRatifiedCount ?? 0} inherited, ${retrieval.orgFallbackCount ?? 0} org fallback`);
|
|
12312
12338
|
}
|
|
@@ -12441,6 +12467,9 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12441
12467
|
...orientView?.taskContext?.isGroundingStub ? { groundingStub: true } : {},
|
|
12442
12468
|
// WP-465 slice ③ (§4.1): served verbatim — identical on CLI and MCP.
|
|
12443
12469
|
...orientView?.taskAlignment ? { taskAlignment: orientView.taskAlignment } : {},
|
|
12470
|
+
// RCRT miss-alarm: machine-readable verdict for structuredContent
|
|
12471
|
+
// consumers (parity with the rendered prose alarm).
|
|
12472
|
+
...orientView?.retrievalMiss ? { retrievalMiss: orientView.retrievalMiss } : {},
|
|
12444
12473
|
orientationStatus: orientationStatus2,
|
|
12445
12474
|
nextStep: hasTaskGrounding ? void 0 : 'Run `orient task="describe the work"` before substantive work.',
|
|
12446
12475
|
...orientView?._budget ? { _budget: orientView._budget } : {}
|
|
@@ -12579,9 +12608,6 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12579
12608
|
const scopedTo = retrieval.resolvedDomainSlug ? ` (${retrieval.resolvedDomainSlug})` : "";
|
|
12580
12609
|
lines.push(`_Domain retrieval: ${retrieval.state}${scopedTo}_`);
|
|
12581
12610
|
if (retrieval.activeSource) lines.push(`_Active source: ${retrieval.activeSource}_`);
|
|
12582
|
-
if (retrieval.fallbackReason) lines.push(`_${retrieval.fallbackReason}_`);
|
|
12583
|
-
if (retrieval.fallbackAction) lines.push(`_${retrieval.fallbackAction}_`);
|
|
12584
|
-
if (retrieval.evidenceGap) lines.push(`_Evidence gap: ${retrieval.evidenceGap}_`);
|
|
12585
12611
|
lines.push("");
|
|
12586
12612
|
}
|
|
12587
12613
|
lines.push(`_Task-scoped entries (${tc.confidence} confidence, ${tc.totalFound} relevant)`);
|
|
@@ -12851,6 +12877,9 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12851
12877
|
...orientView?.taskContext?.isGroundingStub ? { groundingStub: true } : {},
|
|
12852
12878
|
// WP-465 slice ③ (§4.1): served verbatim — identical on CLI and MCP.
|
|
12853
12879
|
...orientView?.taskAlignment ? { taskAlignment: orientView.taskAlignment } : {},
|
|
12880
|
+
// RCRT miss-alarm: machine-readable verdict for structuredContent
|
|
12881
|
+
// consumers (parity with the rendered prose alarm).
|
|
12882
|
+
...orientView?.retrievalMiss ? { retrievalMiss: orientView.retrievalMiss } : {},
|
|
12854
12883
|
domainRetrieval: orientView?.startup?.domainRetrieval,
|
|
12855
12884
|
orientationStatus,
|
|
12856
12885
|
nextStep: hasTaskGrounding ? void 0 : 'Run `orient task="describe the work"` before substantive work.',
|
|
@@ -14744,4 +14773,4 @@ export {
|
|
|
14744
14773
|
createProductBrainServer,
|
|
14745
14774
|
initFeatureFlags
|
|
14746
14775
|
};
|
|
14747
|
-
//# sourceMappingURL=chunk-
|
|
14776
|
+
//# sourceMappingURL=chunk-ZKW7JZUF.js.map
|