feat: Erfolgsmeldung + Auto-Commit nach SHIP
Nach SHIP-Verdikt (sowohl in /optimize als auch /shipit):
- autoCommitIfDirty(): committet uncommitted Änderungen via git add -A + commit,
falls der LLM keinen abschließenden Commit gemacht hat (Sicherheitsnetz)
- notifyShipSuccess(): zeigt prominente Meldung
"✅ Fertig! Das Programm ist jetzt produktionsreif und committed."
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8aadb317e5
commit
5dee5f25e4
1 changed files with 31 additions and 0 deletions
|
|
@ -784,6 +784,27 @@ async function runVersionBump(pi: ExtensionAPI, ctx: ExtensionCommandContext): P
|
|||
ctx.ui.notify(`Version ${newTag} getaggt.`, "info");
|
||||
}
|
||||
|
||||
// Committed alle ungespeicherten Änderungen nach SHIP — Sicherheitsnetz falls der LLM es vergessen hat.
|
||||
async function autoCommitIfDirty(pi: ExtensionAPI, ctx: ExtensionCommandContext): Promise<void> {
|
||||
const status = await pi.exec("bash", ["-c", "git status --porcelain"], { cwd: ctx.cwd });
|
||||
if ((status.stdout ?? "").trim()) {
|
||||
await pi.exec(
|
||||
"bash",
|
||||
["-c", "git add -A && git commit -m 'chore: Abschluss-Commit (produktionsreif)'"],
|
||||
{ cwd: ctx.cwd }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Zeigt die abschließende Erfolgsmeldung nach SHIP.
|
||||
// "info" ist der einzige verfügbare positive Notification-Level in der pi-API.
|
||||
function notifyShipSuccess(ctx: ExtensionCommandContext): void {
|
||||
ctx.ui.notify(
|
||||
"✅ Fertig! Das Programm ist jetzt produktionsreif und committed.",
|
||||
"info"
|
||||
);
|
||||
}
|
||||
|
||||
// Prominente Abschluss-Notification + Widget-Update mit Uhrzeit und Ergebnis.
|
||||
function finalNotify(
|
||||
ctx: ExtensionCommandContext,
|
||||
|
|
@ -965,6 +986,14 @@ export default function (pi: ExtensionAPI) {
|
|||
ctx.ui.notify("Judge prüft finale Freigabe — Ergebnis erscheint im Chat (SHIP / NO-SHIP)", "info");
|
||||
currentActivity = "Judge: finale Freigabe…";
|
||||
await sendAndWait(pi, ctx, shipitPrompt(args || ""));
|
||||
const shipText = getLastAssistantText(ctx);
|
||||
const shipVerdict = shipText.match(/Urteil:\s*(SHIP|NO-SHIP)/i)?.[1]?.toUpperCase() ?? "";
|
||||
if (shipVerdict === "SHIP") {
|
||||
await autoCommitIfDirty(pi, ctx);
|
||||
notifyShipSuccess(ctx);
|
||||
} else if (shipVerdict === "NO-SHIP") {
|
||||
ctx.ui.notify("NO-SHIP — noch Blocker offen. Bitte /fix aufrufen.", "error");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -1138,6 +1167,8 @@ export default function (pi: ExtensionAPI) {
|
|||
|
||||
if (shipVerdict === "SHIP") {
|
||||
ctx.ui.setStatus("optimize", "🚀 SHIP – produktionsreif");
|
||||
await autoCommitIfDirty(pi, ctx);
|
||||
notifyShipSuccess(ctx);
|
||||
finalNotify(ctx, "🚀 SHIP", "Programm ist produktionsreif");
|
||||
await runVersionBump(pi, ctx);
|
||||
if (withDoku) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue