mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-04 10:26:52 +02:00
test(sync-gbrain-readiness): a negation earlier in the claim clause is not a search/write readiness claim
The census unknown actor wrote 'nothing about read, search, or write capability is confirmed either way' after a YELLOW/WARN verdict. The claim window started at 'write', so the leading 'nothing' was outside it. Check the clause subject for nothing/neither/none/no; keep the original in-claim negations. Replay of the captured output passes; positive controls still flag an unnegated claim.
This commit is contained in:
1 parent
6fcb098129
commit
09b686d4ec
2 files changed
+10
-1
No files matched your search
@@ -19,7 +19,9 @@ export function readinessVerdictProblems(kind: 'ready' | 'unknown', output: stri
|
||||
problems.push('unknown result claims GREEN or capability OK');
|
||||
}
|
||||
for (const claim of output.matchAll(/\b(?:semantic search|writes?|write readiness|write availability)[^.!?\n]{0,60}\b(?:ready|verified|proven|confirmed|working)\b/gi)) {
|
||||
if (!/\b(?:not|never|without|unknown|unverified)\b/i.test(claim[0]))
|
||||
const clauseStart = Math.max(...['.', '!', '?', '\n', ';'].map((stop) => output.lastIndexOf(stop, claim.index!)));
|
||||
const subject = output.slice(clauseStart + 1, claim.index!);
|
||||
if (!/\b(?:not|never|without|unknown|unverified)\b/i.test(claim[0]) && !/\b(?:nothing|neither|none|no)\b/i.test(subject))
|
||||
problems.push('read-only check claims semantic search or write readiness');
|
||||
}
|
||||
return problems;
|
||||
|
||||
@@ -27,6 +27,13 @@ test('unknown actor negative replay rejects a contradictory GREEN verdict', () =
|
||||
expect(readinessVerdictProblems('unknown', 'Capability WARN: read unverified; gbrain status: YELLOW')).toEqual([]);
|
||||
});
|
||||
|
||||
test('a negation earlier in the claim sentence is not a search/write readiness claim', () => {
|
||||
const base = 'Capability ...... WARN source-scoped read unverified\ngbrain status: YELLOW\n';
|
||||
expect(readinessVerdictProblems('unknown', `${base}With an unknown result, nothing about read, search, or write capability is confirmed either way.`)).toEqual([]);
|
||||
expect(readinessVerdictProblems('unknown', `${base}Nothing was probed. With an unknown result, write capability is confirmed.`)).toContain('read-only check claims semantic search or write readiness');
|
||||
expect(readinessVerdictProblems('unknown', `${base}Search is not probed; write capability is confirmed.`)).toContain('read-only check claims semantic search or write readiness');
|
||||
});
|
||||
|
||||
test('ready actor negative replay rejects search/write claims from a read probe', () => {
|
||||
const verified = 'Capability ...... OK source-scoped page read verified; semantic search and writes were not tested.\ngbrain status: YELLOW';
|
||||
expect(readinessVerdictProblems('ready', 'Capability ...... OK source-scoped page read verified; semantic search and write readiness verified.\ngbrain status: YELLOW')).not.toEqual([]);
|
||||
|
||||
Reference in new issue
Block a user