@productbrain/mcp 0.0.1-beta.1805 → 0.0.1-beta.1810
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.
|
@@ -1630,6 +1630,7 @@ ${groundingReport.governance.map((g) => `- **${g.entryId}** ${g.name} [${g.colle
|
|
|
1630
1630
|
let formativeHints = [];
|
|
1631
1631
|
let relationSuggestionsFromCreate = [];
|
|
1632
1632
|
let authorityDomainFromCreate;
|
|
1633
|
+
let coachingFromCreate;
|
|
1633
1634
|
let wasAutoCommittedServerSide = false;
|
|
1634
1635
|
try {
|
|
1635
1636
|
const result = await kernelMutation("chain.createEntry", {
|
|
@@ -1643,7 +1644,17 @@ ${groundingReport.governance.map((g) => `- **${g.entryId}** ${g.name} [${g.colle
|
|
|
1643
1644
|
sessionId: agentId ?? void 0,
|
|
1644
1645
|
...sourceRef ? { sourceRef } : {},
|
|
1645
1646
|
...sourceExcerpt ? { sourceExcerpt } : {},
|
|
1646
|
-
...preview ? { preview: true } : {}
|
|
1647
|
+
...preview ? { preview: true } : {},
|
|
1648
|
+
// WP-475 E1 (Codex P2 — CLI parity): user links are known UPFRONT, so the
|
|
1649
|
+
// post-relations re-evaluation below owns the single LLM run — defer the
|
|
1650
|
+
// create-time LLM schedule (deterministic, mirrors `pb capture --link`).
|
|
1651
|
+
// Auto-discovered links are unknown here: zero-user-link captures do NOT
|
|
1652
|
+
// defer (a link-less capture must keep its LLM run); the supersession
|
|
1653
|
+
// guard bounds the auto-link double-run race when timing allows.
|
|
1654
|
+
// Fail-safe: if the relations batch then creates nothing, the deferred row
|
|
1655
|
+
// keeps its delivered heuristic verdict with llmStatus 'skipped' (same
|
|
1656
|
+
// accepted shape as the CLI dying between create and re-eval).
|
|
1657
|
+
...links && links.length > 0 ? { deferLLMSchedule: true } : {}
|
|
1647
1658
|
});
|
|
1648
1659
|
if (result?.preview) {
|
|
1649
1660
|
const hasGrounding = groundingReport.related.length > 0 || groundingReport.duplicates.length > 0 || groundingReport.governance.length > 0;
|
|
@@ -1693,6 +1704,7 @@ No DB writes \u2014 call without \`preview:true\` to capture for real.${result.w
|
|
|
1693
1704
|
relationSuggestionsFromCreate = result.relationSuggestions ?? [];
|
|
1694
1705
|
formativeHints = result.qualityHints ?? [];
|
|
1695
1706
|
authorityDomainFromCreate = result.authorityDomain;
|
|
1707
|
+
coachingFromCreate = result.coaching;
|
|
1696
1708
|
resolveGapsForEntry(name, result.entryId);
|
|
1697
1709
|
if (result.status === "active") {
|
|
1698
1710
|
wasAutoCommittedServerSide = true;
|
|
@@ -1824,16 +1836,24 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
|
|
|
1824
1836
|
}) : Promise.resolve(null);
|
|
1825
1837
|
const cardinalityPromise = resolvedCK ? kernelQuery("chain.checkCardinalityWarning", { canonicalKey: resolvedCK }).catch(() => null) : Promise.resolve(null);
|
|
1826
1838
|
const contradictionPromise = runContradictionCheck(name, description);
|
|
1827
|
-
const coachingPromise = kernelMutation("quality.evaluateHeuristicAndSchedule", {
|
|
1839
|
+
const coachingPromise = coachingFromCreate !== void 0 ? Promise.resolve(coachingFromCreate) : kernelMutation("quality.evaluateHeuristicAndSchedule", {
|
|
1828
1840
|
entryId: finalEntryId,
|
|
1829
1841
|
context: "capture"
|
|
1830
1842
|
}).catch(() => null);
|
|
1831
|
-
const [batchResult, cardinalityCheck, contradictionWarnings,
|
|
1843
|
+
const [batchResult, cardinalityCheck, contradictionWarnings, coachingAtCreate] = await Promise.all([
|
|
1832
1844
|
batchRelationsPromise,
|
|
1833
1845
|
cardinalityPromise,
|
|
1834
1846
|
contradictionPromise,
|
|
1835
1847
|
coachingPromise
|
|
1836
1848
|
]);
|
|
1849
|
+
let verdictResult = coachingAtCreate;
|
|
1850
|
+
if ((batchResult?.created ?? 0) > 0) {
|
|
1851
|
+
const reEval = await kernelMutation("quality.evaluateHeuristicAndSchedule", {
|
|
1852
|
+
entryId: finalEntryId,
|
|
1853
|
+
context: "capture"
|
|
1854
|
+
}).catch(() => null);
|
|
1855
|
+
if (reEval?.verdict) verdictResult = reEval;
|
|
1856
|
+
}
|
|
1837
1857
|
const tAfterRelations = Date.now();
|
|
1838
1858
|
if (batchResult) {
|
|
1839
1859
|
for (let i = 0; i < pendingRelations.length; i++) {
|
|
@@ -14689,4 +14709,4 @@ export {
|
|
|
14689
14709
|
createProductBrainServer,
|
|
14690
14710
|
initFeatureFlags
|
|
14691
14711
|
};
|
|
14692
|
-
//# sourceMappingURL=chunk-
|
|
14712
|
+
//# sourceMappingURL=chunk-MIJAUKD3.js.map
|