fix: preserve live status blocker attribution
This commit is contained in:
@@ -119,7 +119,6 @@ const defaultHomepageForbiddenTerms = Object.freeze([
|
||||
"m3-hardware-loop-runtime",
|
||||
"trace/evidence",
|
||||
"执行轨迹",
|
||||
"runtime_durable_adapter_query_blocked",
|
||||
"OPENAI_API_KEY",
|
||||
"Secret",
|
||||
"secretRef",
|
||||
@@ -4233,7 +4232,7 @@ async function inspectDefaultApiStatus(page) {
|
||||
const liveStatus = document.querySelector("#live-status")?.textContent?.trim() ?? "";
|
||||
const liveDetail = document.querySelector("#live-detail")?.textContent?.trim() ?? "";
|
||||
const firstScreenText = document.querySelector(".topbar")?.textContent?.replace(/\s+/gu, " ").trim() ?? "";
|
||||
const forbidden = /Gate|诊断|验收|BLOCKED|M0-M5|执行轨迹|runtime_durable_adapter_query_blocked|DB live readiness/u;
|
||||
const forbidden = /Gate|诊断|验收|BLOCKED|M0-M5|执行轨迹|DB live readiness/u;
|
||||
return {
|
||||
liveStatus,
|
||||
liveDetail,
|
||||
|
||||
@@ -971,8 +971,7 @@ function probeAttribution(probe) {
|
||||
}
|
||||
|
||||
function displayReasonCode(reasonCode) {
|
||||
const text = String(reasonCode ?? "");
|
||||
return text.startsWith("runtime_durable_adapter_") ? "runtime durable" : text;
|
||||
return String(reasonCode ?? "");
|
||||
}
|
||||
|
||||
function displayReasonText(reason) {
|
||||
|
||||
@@ -448,6 +448,7 @@ test("classifies durable runtime degraded as explicit read-only mode", () => {
|
||||
assert.equal(status.label, "只读模式");
|
||||
assert.equal(status.reasonCode, "runtime_durable_adapter_schema_blocked");
|
||||
assert.match(status.detail, /只读:hwlab-cloud-api \/health\/live/u);
|
||||
assert.match(status.detail, /runtime_durable_adapter_schema_blocked/u);
|
||||
assert.match(status.detail, /schema_blocked/u);
|
||||
assert.deepEqual(status.internalRawStatuses.filter((item) => item === "degraded"), ["degraded"]);
|
||||
});
|
||||
@@ -553,6 +554,7 @@ test("classifies auth and migration durable blockers with shared runtime reason"
|
||||
|
||||
assert.equal(status.kind, "readonly");
|
||||
assert.equal(status.reasonCode, reasonCode);
|
||||
assert.match(status.detail, new RegExp(reasonCode, "u"));
|
||||
assert.match(status.detail, new RegExp(queryResult, "u"));
|
||||
}
|
||||
});
|
||||
@@ -822,7 +824,7 @@ test("fixture matrix preserves runtime durable blocked attribution when durabili
|
||||
assert.equal(durable.evidence.blockedLayer, "durability_query");
|
||||
assert.equal(status.kind, "readonly");
|
||||
assert.equal(status.reasonCode, "runtime_durable_adapter_query_blocked");
|
||||
assert.match(status.detail, /runtime durable/u);
|
||||
assert.match(status.detail, /runtime_durable_adapter_query_blocked/u);
|
||||
assert.match(status.detail, /query_blocked/u);
|
||||
});
|
||||
|
||||
@@ -846,6 +848,7 @@ test("fixture matrix keeps auth and schema runtime blockers on their exact layer
|
||||
assert.equal(durable.evidence.queryResult, expectedQuery);
|
||||
assert.equal(status.kind, "readonly");
|
||||
assert.equal(status.reasonCode, expectedReason);
|
||||
assert.match(status.detail, new RegExp(expectedReason, "u"));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user