- pi-coder-judge-extension.ts: licenceMd() + writeLicenceMd() — erzeugt proprietäre LICENCE.md in der Doku-Phase (nur wenn noch nicht vorhanden) - tests: Guards und pure-logic-Tests für LICENCE.md ergänzt (38 Tests, alle grün) - .gitignore: Node, TypeScript-Artefakte, Backups, Editor-Dateien, OS-Metadaten - README.md + BEDIENUNGSANLEITUNG.md: vollständig auf Single-GPU-Architektur aktualisiert (ein Server, System-Prompt-Rollen, kein Quick-Judge, PASS WITH CONCERNS-Verhalten, LICENCE.md in /update_doku, start-single.sh) - SINGLE_SERVER_PLAN.md: entfernt (umgesetzt, kein Mehrwert mehr) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
60 lines
2.9 KiB
JavaScript
60 lines
2.9 KiB
JavaScript
// Statische Regression-Guards: sichern die konkreten Fixes/Umbauten gegen versehentliches
|
|
// Zurückdrehen ab. Prüft den Extension-Quelltext, ohne ihn auszuführen.
|
|
|
|
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { extSource } from "./helpers.mjs";
|
|
|
|
test("Crash-Fix: ctx.ui.select wird positional aufgerufen, nicht mit einem Objekt", () => {
|
|
// Der Crash 'reading length' entstand durch ctx.ui.select({...}) statt select(title, options[]).
|
|
assert.doesNotMatch(extSource, /ui\.select\(\s*\{/, "ui.select darf NICHT mit Objekt aufgerufen werden");
|
|
assert.match(extSource, /ui\.select\(\s*titleLine\s*,\s*\[/, "ui.select muss (title, options[]) erhalten");
|
|
});
|
|
|
|
test("Single-GPU: keine switchModel-Aufrufe mehr (durch selectRole ersetzt)", () => {
|
|
assert.doesNotMatch(extSource, /switchModel\s*\(\s*pi/);
|
|
assert.match(extSource, /function selectRole\b/);
|
|
assert.match(extSource, /function ensureSingleModel\b/);
|
|
});
|
|
|
|
test("System-Prompt-Rollen: before_agent_start-Hook injiziert Coder-/Judge-Persona", () => {
|
|
assert.match(extSource, /pi\.on\(\s*["']before_agent_start["']/);
|
|
assert.match(extSource, /function coderPersona\b/);
|
|
assert.match(extSource, /function judgePersona\b/);
|
|
// Persona wird angehängt, nicht ersetzt (Pi-Basis-System-Prompt bleibt erhalten).
|
|
assert.match(extSource, /event\.systemPrompt\s*\+/);
|
|
});
|
|
|
|
test("Quick-Judge abgeschafft: keine quickJudge-Prompt-Funktionen mehr", () => {
|
|
assert.doesNotMatch(extSource, /function quickJudgePrompt\b/);
|
|
assert.doesNotMatch(extSource, /function quickJudgeWithTestsPrompt\b/);
|
|
});
|
|
|
|
test("Fix-Auslösung: PASS WITH CONCERNS gilt nur mit --approve-concerns als bestanden", () => {
|
|
assert.match(extSource, /passed\s*=\s*verdict === "PASS"/);
|
|
assert.match(extSource, /verdict === "PASS WITH CONCERNS"\s*&&\s*approveConcerns/);
|
|
// und der Bestanden-Zweig nutzt 'passed', nicht mehr das alte 'verdict === PASS WITH CONCERNS'.
|
|
assert.match(extSource, /if\s*\(\s*passed\s*\)/);
|
|
});
|
|
|
|
test("Loop-Erkennung greift auch ohne Blocker-Abschnitt (Fallback auf Gesamttext)", () => {
|
|
assert.match(extSource, /parseBlockers\(judgeText\)\s*\|\|\s*judgeText/);
|
|
});
|
|
|
|
test("currentRole wird nach jedem optimize-Lauf auf 'coder' zurückgesetzt", () => {
|
|
assert.match(extSource, /currentRole\s*=\s*"coder"/);
|
|
});
|
|
|
|
test("LICENCE.md: deterministisch in der Doku-Phase, nur wenn nicht vorhanden, proprietär", () => {
|
|
assert.match(extSource, /function licenceMd\b/);
|
|
assert.match(extSource, /async function writeLicenceMd\b/);
|
|
// wird in runUpdateDoku aufgerufen
|
|
assert.match(extSource, /await writeLicenceMd\(pi, ctx\)/);
|
|
// existierende Lizenz wird nicht überschrieben
|
|
assert.match(extSource, /test -f LICENCE\.md/);
|
|
// proprietärer Default
|
|
assert.match(extSource, /Alle Rechte vorbehalten/);
|
|
// Inhaber aus git config, Jahr aus aktuellem Datum
|
|
assert.match(extSource, /git config user\.name/);
|
|
assert.match(extSource, /new Date\(\)\.getFullYear\(\)/);
|
|
});
|