fix: Loop-Erkennung meldet bei „Blocker: Keine“ keinen falschen Schleifenabbruch
Zwei Judge-Runden mit „Blocker: Keine“ und verschiedenen Major-Punkten galten als „gleicher Blocker zweimal“. loopKey() vergleicht jetzt die Blocker, bei leerem Blocker-Abschnitt die Major-Punkte, sonst den ganzen Judge-Text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a608f1dda8
commit
2acfc85482
2 changed files with 50 additions and 7 deletions
|
|
@ -38,7 +38,7 @@ test("Fix-Auslösung: PASS WITH CONCERNS gilt nur mit --approve-concerns als bes
|
|||
});
|
||||
|
||||
test("Loop-Erkennung greift auch ohne Blocker-Abschnitt (Fallback auf Gesamttext)", () => {
|
||||
assert.match(extSource, /parseBlockers\(judgeText\)\s*\|\|\s*judgeText/);
|
||||
assert.match(extSource, /const currentBlockers = loopKey\(judgeText\)/);
|
||||
});
|
||||
|
||||
test("currentRole wird nach jedem Kommando auf 'idle' zurückgesetzt (kein Persona-Leak in freien Chat)", () => {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const parseVerdict = extractFn("parseVerdict");
|
|||
const parseBlockers = extractFn("parseBlockers");
|
||||
const normalizeForComparison = extractFn("normalizeForComparison");
|
||||
const licenceMd = extractFn("licenceMd");
|
||||
const loopKey = extractFn("loopKey");
|
||||
|
||||
test("parseVerdict: klares PASS", () => {
|
||||
assert.equal(parseVerdict("Review fertig.\nUrteil: PASS\nKeine Blocker."), "PASS");
|
||||
|
|
@ -78,3 +79,26 @@ test("licenceMd: proprietärer Default mit eingesetztem Jahr und Inhaber", () =>
|
|||
test("licenceMd: Platzhalter-Inhaber wird unverändert eingesetzt", () => {
|
||||
assert.match(licenceMd("2030", "[Rechteinhaber eintragen]"), /Copyright \(c\) 2030 \[Rechteinhaber eintragen\]/);
|
||||
});
|
||||
|
||||
test("loopKey: echte Blocker sind der Schlüssel", () => {
|
||||
const txt = "## Blocker\n- B1 Absturz bei leerer Eingabe\n\n## Major\n- M1 x";
|
||||
assert.match(loopKey(txt), /B1 Absturz/);
|
||||
assert.doesNotMatch(loopKey(txt), /M1/);
|
||||
});
|
||||
|
||||
test("loopKey: 'Blocker: Keine' → Major-Punkte statt Fehlalarm (Strata-Probe 15.10.)", () => {
|
||||
const r1 = "## Urteil: **PASS WITH CONCERNS**\n\n## Blocker\n- Keine.\n\n## Major\n- M1 Flags als Name\n\n## Minor\n- N1";
|
||||
const r2 = "## Urteil: **PASS WITH CONCERNS**\n\n## Blocker\n- Keine.\n\n## Major\n- M1 UTF-8-Absturz\n\n## Minor\n- N1";
|
||||
assert.notEqual(loopKey(r1), loopKey(r2));
|
||||
assert.match(loopKey(r1), /^MAJOR: - M1 Flags/);
|
||||
});
|
||||
|
||||
test("loopKey: gleiche Major-Punkte zweimal → gleicher Schlüssel (Loop wird erkannt)", () => {
|
||||
const r = "**Blocker**\nkeine\n**Major**\n- M1 gleich\n**Minor**\n- n";
|
||||
assert.equal(loopKey(r), loopKey(r + "\n"));
|
||||
});
|
||||
|
||||
test("loopKey: weder Blocker noch Major → ganzer Text", () => {
|
||||
assert.equal(loopKey("Urteil: FAIL\nirgendwas"), "Urteil: FAIL\nirgendwas");
|
||||
assert.equal(loopKey("## Blocker\nNone\n## Major\n-"), "## Blocker\nNone\n## Major\n-");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue