feat: Add PeerTube & PieFed auto-update, improve classifier

Add auto-update scripts and review examples for PeerTube and PieFed,
bringing total auto-updating services to three.

The classifier now includes the current and target version in the
prompt so it can correctly evaluate conditional upgrade notes like
"follow v8.1.0 instructions if upgrading from <= v8.0.2". Without
this context the model would conservatively flag patch releases as
manual.

All auto-update wrappers now use `bash -euo pipefail` when calling
remote scripts so failures in upstream deploy/upgrade scripts
propagate correctly instead of silently succeeding.

test_classifier.py now accepts a service name argument and derives
realistic version numbers from the release notes for testing.
This commit is contained in:
Jeena 2026-04-12 23:13:26 +00:00
parent f55f3d8e91
commit 67a9509eaa
13 changed files with 376 additions and 10 deletions

View file

@ -49,7 +49,7 @@ class Classifier:
if not examples:
return {"action": "manual", "reason": "No review examples configured; defaulting to manual review."}
messages = self._build_messages(service_dir.name, examples, release_notes)
messages = self._build_messages(service_dir.name, examples, release_notes, current, latest)
try:
payload = json.dumps({
@ -83,6 +83,8 @@ class Classifier:
service_name: str,
examples: List[Dict[str, str]],
release_notes: str,
current: str,
latest: str,
) -> List[Dict[str, str]]:
system_prompt = (
f"You are an update safety classifier for self-hosted {service_name} instances.\n"
@ -93,6 +95,8 @@ class Classifier:
"- Classify only THIS release, not future or past releases mentioned in the notes.\n"
"- Warnings or announcements about breaking changes in upcoming versions do NOT\n"
" make the current release manual.\n"
"- Conditional notes like 'follow X instructions if upgrading from <= Y' only apply\n"
" if the current running version is <= Y. If we are already past Y, they do not apply.\n"
'- Respond ONLY with a JSON object: {"action": "auto", "reason": "..."}\n'
' or {"action": "manual", "reason": "..."}\n'
"- Keep reason under 60 words."
@ -104,5 +108,8 @@ class Classifier:
"role": "assistant",
"content": json.dumps({"action": ex["action"], "reason": ex["reason"]}),
})
messages.append({"role": "user", "content": f"Release notes:\n{release_notes}"})
messages.append({
"role": "user",
"content": f"Upgrading from {current} to {latest}.\n\nRelease notes:\n{release_notes}",
})
return messages