跳到正文
DEV Community· Teng·· 2 小時前AI 評分50

SlothPulse 以本機 Gemma 將 Git 提交和終端錯誤整理成站會草稿

SlothPulse: I wrote the code. Gemma can draft the standup.

AI 導讀

Teng 開發 SlothPulse,透過本機 Ollama 執行 Gemma,將近期 Git 提交及終端錯誤整理成站會草稿。單一命令會輸出已完成工作、阻礙和建議後續步驟三個 Markdown 區段,每項附有來源引用供核對,草稿則儲存在本機;CLI 亦會驗證引用類型。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady.

💡 What I Built

After a day of writing code, “what did you do today?” shouldn’t require another Git archaeology session.

I built SlothPulse to turn recent commits and a terminal error into a standup draft using Gemma running locally through Ollama. One command produces three Markdown sections: completed work, blockers, and suggested next steps.

Every item has a receipt pointing back to its source, so you can check anything suspicious before sharing the draft. The note stays in a local file.

🎥 Demo

Open the recorded demo → — click a source badge to inspect its commit or error, or watch the 48-second video.

SlothPulse: your standup, with receipts

python3 slothpulse.py --since today --error-file error.txt

An excerpt from the actual saved draft:

### 🛠️ What I Did Today
- Fixed issue where export job IDs were lost during retries. [^C1]

### 🐛 Blockers & Bugs
- User-reported: KeyError: 'result' while downloading job results. [^E1]

### 🚀 Next Steps
- Suggested: Investigate the origin of the KeyError and potential data access issues in worker.py. [^E1]

The full captured run summarizes five commits and one traceback in 10.33 seconds inside the CLI. The fixture uses fictional authors and a deliberately fake key; the tiny worker really raises the captured error. The video replays timestamped output, including the measured wait.

💻 Code

GitHub logo TengByte / slothpulse

A 100% local, privacy-first CLI that turns Git commits and error traces into developer digests with Ollama and Gemma.

Setup and source · Exact input and output · Build log

🛠️ How I Built It

The first version produced a tidy recap—and attributed a pasted error to SlothPulse itself, although its source was unspecified. That unsupported connection mattered more than the formatting.

I moved the model’s response to JSON with required source keys. Every commit gets a C key. Each reported error gets an E object containing both its summary and investigation step. Python assigns their references and renders the Markdown.

That pairing came from another real failure: an error investigation cited an unrelated commit. Both IDs existed, so checking whether a source was known had missed the problem. Keeping the error and its follow-up together removes that particular mismatch.

The CLI validates coverage and reference types, retries an invalid plan once, and saves no digest if the second attempt fails. A valid reference still cannot prove that a sentence is correct; human review stays in the workflow.

The application uses Python’s standard library: subprocess for Git, urllib.request for Ollama, and json for the response contract. No external Python packages. The code is MIT licensed.

🔒 Why Does Open Innovation Matter?

Commit subjects and traces can contain private project details. Downloaded Gemma weights let the recap run on the same machine as that context, without a hosted inference account or API key. The model download needs internet access; generation stays local.

SlothPulse checks model metadata before sending context, rejects cloud-backed models, and bypasses HTTP proxies. The tested Ollama server runs with OLLAMA_NO_CLOUD=1. These checks trust the local server and its metadata.

Before generating, --preview shows the sanitized input without a model call or file write. Common credential patterns are masked, but masking is best effort: preview it, and treat saved notes as potentially confidential.

🦥 The Lazy Payoff

The chore becomes reviewing a draft instead of assembling one from scattered context. To check this beyond the demo fixture, I ran SlothPulse on this project’s six real commits, using local Gemma on an Apple M5 / 16 GB:

Invocation Whole process time
Model initially unloaded 13.619 s
Immediate repeat 8.720 s

Review caught one important correction among the six completed-work items: Gemma turned “submission handoff” into “submitted,” while this entry was still a draft. The receipt made that mismatch easy to locate. The raw output and the corrected version are both preserved in the repository trial.

This was an AI-assisted source check, not a human standup study. Manual preparation time and human editing effort remain unmeasured. The earlier nine-run synthetic benchmark and 23 unit tests check workflow behavior and failure boundaries; factual accuracy still needs review.

🏆 Prize Categories

  • Best Use of Gemma — local Gemma drafts the summaries and investigation steps.

Codex assisted with implementation, testing, demo preparation, and this article. More engineering notes: tengli.dev.

來源:DEV Community · dev.to