phase2-4 recall prompt-flow hardening

This commit is contained in:
Youzini-afk
2026-04-11 18:51:50 +08:00
parent 3a10dbb9ba
commit 0cb95c4f2b
14 changed files with 1069 additions and 143 deletions

View File

@@ -7349,6 +7349,11 @@ function _renderRegexReuseBadges(rule = {}) {
className: "is-transform",
text: "宿主真实执行",
});
} else if (rule.promptStageMode === "host-helper") {
badges.push({
className: "is-prompt",
text: "Helper 兼容执行",
});
} else if (rule.promptStageMode === "host-fallback") {
badges.push({
className: "is-prompt",
@@ -7514,7 +7519,7 @@ function _buildRegexReusePopupContent(snapshot = {}) {
</div>
<div class="bme-regex-preview-summary__item">
<span class="bme-regex-preview-summary__label">桥接模式</span>
<span class="bme-regex-preview-summary__value">${_escHtml(snapshot.host?.sourceLabel || "unknown")} · ${_escHtml(snapshot.host?.executionMode || snapshot.host?.capabilityStatus?.mode || snapshot.host?.mode || "unknown")}${snapshot.host?.formatterAvailable ? " · formatter" : ""}${snapshot.host?.fallback ? " · fallback" : ""}</span>
<span class="bme-regex-preview-summary__value">${_escHtml(snapshot.host?.sourceLabel || "unknown")} · ${_escHtml(snapshot.host?.executionMode || snapshot.host?.capabilityStatus?.mode || snapshot.host?.mode || "unknown")}${snapshot.host?.bridgeTier ? ` · ${_escHtml(snapshot.host.bridgeTier)}` : ""}${snapshot.host?.formatterAvailable ? " · formatter" : ""}${snapshot.host?.fallback ? " · fallback" : ""}</span>
</div>
</div>
</div>

View File

@@ -82,6 +82,7 @@ function formatTokenHint(tokenEstimate) {
function formatMetaLine(record) {
const parts = [];
if (record.recallSource) parts.push(`来源: ${record.recallSource}`);
if (record.authoritativeInputUsed) parts.push("权威输入");
if (record.tokenEstimate > 0) parts.push(`~${record.tokenEstimate} tokens`);
if (Number.isFinite(record.generationCount) && record.generationCount > 0) {
parts.push(`回退 ${record.generationCount}`);
@@ -180,6 +181,8 @@ function buildExpandedRenderSignature({
return stableSerialize({
updatedAt: String(record?.updatedAt || ""),
manuallyEdited: Boolean(record?.manuallyEdited),
authoritativeInputUsed: Boolean(record?.authoritativeInputUsed),
boundUserFloorText: String(record?.boundUserFloorText || ""),
generationCount: Number.isFinite(record?.generationCount)
? record.generationCount
: 0,