@productbrain/mcp 0.0.1-beta.1823 → 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.
|
@@ -3389,12 +3389,14 @@ ${formatted}` }],
|
|
|
3389
3389
|
await recordSessionActivity({ contradictionWarning: true });
|
|
3390
3390
|
}
|
|
3391
3391
|
let coachingResult = null;
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3392
|
+
if (!preview) {
|
|
3393
|
+
try {
|
|
3394
|
+
coachingResult = await kernelMutation("quality.evaluateHeuristicAndSchedule", {
|
|
3395
|
+
entryId,
|
|
3396
|
+
context: "commit"
|
|
3397
|
+
});
|
|
3398
|
+
} catch {
|
|
3399
|
+
}
|
|
3398
3400
|
}
|
|
3399
3401
|
let result;
|
|
3400
3402
|
try {
|
|
@@ -12070,6 +12072,27 @@ function replaceVocabTokens(body, workspaceCtx, collectionCtxMap) {
|
|
|
12070
12072
|
|
|
12071
12073
|
// src/tools/orient.ts
|
|
12072
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
|
+
}
|
|
12073
12096
|
var NON_MEANINGFUL_TASK_RE = /^[\s]*$/u;
|
|
12074
12097
|
function taskIsMeaningful(task) {
|
|
12075
12098
|
if (typeof task !== "string") return false;
|
|
@@ -12272,6 +12295,14 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12272
12295
|
}
|
|
12273
12296
|
lines.push("");
|
|
12274
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
|
+
}
|
|
12275
12306
|
if (mode === "brief") {
|
|
12276
12307
|
const briefStage = readiness?.stage ?? (readiness?.score != null ? readiness.score < 50 ? "seeded" : "grounded" : "unknown");
|
|
12277
12308
|
lines.push(`Brain stage: ${briefStage}`);
|
|
@@ -12302,9 +12333,6 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12302
12333
|
const scopedTo = retrieval.resolvedDomainSlug ? ` (${retrieval.resolvedDomainSlug})` : "";
|
|
12303
12334
|
lines.push(`Domain retrieval: ${retrieval.state}${scopedTo}`);
|
|
12304
12335
|
if (retrieval.activeSource) lines.push(`Active source: ${retrieval.activeSource}`);
|
|
12305
|
-
if (retrieval.fallbackReason) lines.push(`Fallback: ${retrieval.fallbackReason}`);
|
|
12306
|
-
if (retrieval.fallbackAction) lines.push(`Action: ${retrieval.fallbackAction}`);
|
|
12307
|
-
if (retrieval.evidenceGap) lines.push(`Evidence gap: ${retrieval.evidenceGap}`);
|
|
12308
12336
|
if (retrieval.directRatifiedCount != null || retrieval.inheritedRatifiedCount != null || retrieval.orgFallbackCount != null) {
|
|
12309
12337
|
lines.push(`Domain relation evidence: ${retrieval.directRatifiedCount ?? 0} direct, ${retrieval.inheritedRatifiedCount ?? 0} inherited, ${retrieval.orgFallbackCount ?? 0} org fallback`);
|
|
12310
12338
|
}
|
|
@@ -12439,6 +12467,9 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12439
12467
|
...orientView?.taskContext?.isGroundingStub ? { groundingStub: true } : {},
|
|
12440
12468
|
// WP-465 slice ③ (§4.1): served verbatim — identical on CLI and MCP.
|
|
12441
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 } : {},
|
|
12442
12473
|
orientationStatus: orientationStatus2,
|
|
12443
12474
|
nextStep: hasTaskGrounding ? void 0 : 'Run `orient task="describe the work"` before substantive work.',
|
|
12444
12475
|
...orientView?._budget ? { _budget: orientView._budget } : {}
|
|
@@ -12577,9 +12608,6 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12577
12608
|
const scopedTo = retrieval.resolvedDomainSlug ? ` (${retrieval.resolvedDomainSlug})` : "";
|
|
12578
12609
|
lines.push(`_Domain retrieval: ${retrieval.state}${scopedTo}_`);
|
|
12579
12610
|
if (retrieval.activeSource) lines.push(`_Active source: ${retrieval.activeSource}_`);
|
|
12580
|
-
if (retrieval.fallbackReason) lines.push(`_${retrieval.fallbackReason}_`);
|
|
12581
|
-
if (retrieval.fallbackAction) lines.push(`_${retrieval.fallbackAction}_`);
|
|
12582
|
-
if (retrieval.evidenceGap) lines.push(`_Evidence gap: ${retrieval.evidenceGap}_`);
|
|
12583
12611
|
lines.push("");
|
|
12584
12612
|
}
|
|
12585
12613
|
lines.push(`_Task-scoped entries (${tc.confidence} confidence, ${tc.totalFound} relevant)`);
|
|
@@ -12849,6 +12877,9 @@ async function _handleOrient({ mode = "full", tier, task, scope }) {
|
|
|
12849
12877
|
...orientView?.taskContext?.isGroundingStub ? { groundingStub: true } : {},
|
|
12850
12878
|
// WP-465 slice ③ (§4.1): served verbatim — identical on CLI and MCP.
|
|
12851
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 } : {},
|
|
12852
12883
|
domainRetrieval: orientView?.startup?.domainRetrieval,
|
|
12853
12884
|
orientationStatus,
|
|
12854
12885
|
nextStep: hasTaskGrounding ? void 0 : 'Run `orient task="describe the work"` before substantive work.',
|
|
@@ -14742,4 +14773,4 @@ export {
|
|
|
14742
14773
|
createProductBrainServer,
|
|
14743
14774
|
initFeatureFlags
|
|
14744
14775
|
};
|
|
14745
|
-
//# sourceMappingURL=chunk-
|
|
14776
|
+
//# sourceMappingURL=chunk-ZKW7JZUF.js.map
|