Skip to content

Commit 3647bc0

Browse files
committed
fix(issue): Safety: crossReferenceEvidence commented out, fabricated evidence bypasses check
1 parent 8906b64 commit 3647bc0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/resources/extensions/gsd/auto-post-unit.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,6 @@ export async function postUnitPreVerification(pctx: PostUnitContext, opts?: PreV
10041004
if (safetyConfig.evidence_cross_reference && s.currentUnit.type === "execute-task") {
10051005
try {
10061006
const actual = getEvidence();
1007-
const bashCalls = actual.filter(e => e.kind === "bash");
10081007
if (sMid && sSid && sTid && isDbAvailable()) {
10091008
const taskRow = getTask(sMid, sSid, sTid);
10101009
if (taskRow?.status === "complete") {
@@ -1027,10 +1026,13 @@ export async function postUnitPreVerification(pctx: PostUnitContext, opts?: PreV
10271026
}
10281027
}
10291028

1030-
if (claimedEvidence.length > 0 && bashCalls.length === 0) {
1031-
logWarning("safety", "task claimed verification command evidence but no execution tool calls were recorded");
1029+
const missingCommandMismatches = mismatches.filter((mismatch) => (
1030+
mismatch.severity === "warning" && mismatch.actual === null
1031+
));
1032+
if (missingCommandMismatches.length > 0) {
1033+
logWarning("safety", `evidence mismatch: ${missingCommandMismatches.length} claimed command(s) not found in bash calls`);
10321034
ctx.ui.notify(
1033-
`Safety: task ${sTid} claimed command evidence but no execution tool calls were recorded`,
1035+
`Safety: task ${sTid} claimed ${missingCommandMismatches.length} command(s) not found in recorded bash calls`,
10341036
"warning",
10351037
);
10361038
}

0 commit comments

Comments
 (0)