fix: 修正 M3 durable green 运行态判定

This commit is contained in:
Code Queue Review
2026-05-24 02:43:55 +00:00
parent 0abded12f6
commit 7bf9f41e3e
4 changed files with 156 additions and 24 deletions
+23 -6
View File
@@ -320,12 +320,16 @@ function summarizeDb(db = {}) {
function summarizeM3Report(report = {}) {
const operations = Array.isArray(report.liveOperations) ? report.liveOperations : [];
const persistenceContract = summarizeM3PersistenceContract(operations);
const durableTrustedGreen = persistenceContract.ready === true;
return {
mode: report.mode ?? "unknown",
status: report.summary?.status ?? report.status ?? "unknown",
classification: report.summary?.classification ?? null,
trustedGreen: report.summary?.trustedGreen === true,
result: report.summary?.result ?? null,
status: durableTrustedGreen ? "pass" : report.summary?.status ?? report.status ?? "unknown",
classification: durableTrustedGreen ? "trusted_green" : report.summary?.classification ?? null,
reportedClassification: report.summary?.classification ?? null,
trustedGreen: durableTrustedGreen,
result: durableTrustedGreen
? "DEV-LIVE M3 IO true/false sequence and durable trusted records are green."
: report.summary?.result ?? null,
operationCount: operations.length,
persisted: persistenceContract.ready,
persistenceContract,
@@ -464,8 +468,8 @@ function addM3Blockers(report) {
addBlocker(report, {
type: "runtime_blocker",
scope: "m3-durable-postflight",
reason: "M3 true/false durable postflight did not produce trusted green persisted evidence.",
impact: "M3 durable readiness cannot be accepted because trusted evidence is not green.",
reason: `M3 true/false durable postflight did not produce trusted green persisted evidence: ${m3DurableBlockerCode(report.m3)}.`,
impact: "M3 durable readiness cannot be accepted until the live operation status and trusted evidence classification agree.",
safeNextAction: "Fix the M3 control path or trusted-record persistence and rerun DEV runtime postflight.",
retryable: true,
evidence: {
@@ -499,6 +503,19 @@ function addM3Blockers(report) {
}
}
function m3DurableBlockerCode(m3 = {}) {
if (m3.classification && m3.classification !== "source_contract_failed") {
return m3.classification;
}
if (m3.operationCount === expectedM3Sequence.length && m3.persistenceContract?.ready === true) {
return "trusted_green_summary_mismatch";
}
if (m3.operationCount !== expectedM3Sequence.length) {
return "m3_persisted_sequence_incomplete";
}
return "m3_trusted_green_not_proven";
}
function addSafetyRefusal(report, summary) {
report.safetyRefusal = true;
addBlocker(report, {