feat: guarantee a Progress.md note per run + Nous-style post-task learning#20
Merged
Merged
Conversation
…rning Two follow-ups to #18 so a completed run leaves durable, trustworthy state. 1. DETERMINISTIC Progress.md note (the guarantee). On every terminal outcome the completion path now writes the run into the project's Progress.md under a dedicated "## Hermes Run Log" section (newest-first, human sections untouched). This is plain Python on the completion path — "done" GUARANTEES a note exists; it no longer depends on a sub-agent choosing to write one. (Nothing wrote Progress.md before — agents only ever wrote their own step output notes.) 2. NOUS-STYLE post-task learning (the nice-to-have). On success, a non-blocking background reviewer distills the run's step notes via LOCAL Ollama (free, zero Claude tokens — same path as the resume handoff) into a Progress.md "Learnings" entry, and — only if a genuinely reusable procedure emerged — a skill CANDIDATE staged in ~/hermes/skill-candidates/ (gitignored) with a Telegram ping to review. Candidates are NEVER auto-installed into ~/.claude/skills (globally active in every session) — Jaiden promotes by hand. Refactor: extracted the shared local-Ollama call into `_ollama_generate` (handoff + reviewer both use it). Tests: 149 pass / 1 skip (+5 — deterministic writer create/append/newest-first + review parsing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…no-skill gate Applies the Fable code-review findings on this PR: - H1 (security): _skill_name now sanitizes the model-supplied name to a safe bare filename (`[^a-z0-9-]`→`-`). An 8B `name: ../../.claude/skills/x` (or absolute path) would otherwise escape the staging dir into the globally-active skills folder — defeating the whole review gate. Staging also re-checks the resolved path stays inside skill-candidates/. - M2 (spam): stage a candidate ONLY when the section parses as a real frontmatter skill with a name — no timestamp fallback. A paraphrased "No skill needed" or prose no longer stages a garbage file or pings Jaiden on a plain success. Reviewer prompt also tightened to DEFAULT TO NO_SKILL. - H2 (routing): _prepend_under_runlog resolves the vault folder via the registry (raphbrain_dir), not project.capitalize() — hyphenated projects (finance-tracker) no longer write to an orphan folder nothing reads. - M1 (race): _prepend_under_runlog runs under a module lock — a slow review thread and the next run's deterministic write can't clobber each other's Progress.md. - L1/L2/nits: line-anchored header match, utf-8 on reads/writes, _ollama_generate catches HTTPError/JSONDecodeError with the real message. Tests: 153 pass / 1 skip (+4): name sanitization incl. traversal, paraphrased no-skill, registry-folder routing, header-without-trailing-newline. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d review)
Fresh review caught the no-trailing-newline fix was incomplete AND its test masked
it: when the header is the file's last line with no trailing newline, the entry
glued onto it ('## Hermes Run Log### …') and the next run appended a 2nd section.
Now insert a separator; test does two inserts + asserts one section. Also adds the
missing end-to-end staging tests for spawn_post_task_review (real skill stages +
pings; NO_SKILL stages nothing), and documents cross-process as out of scope.
Tests: 155 pass / 1 skip (+2).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
JaidenSy
force-pushed
the
feature/deterministic-notes-and-post-task-review
branch
from
July 23, 2026 01:48
1be1d8d to
20caba2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18. Makes a completed run leave durable, trustworthy state — the two items I flagged as "still on the table."
1. Deterministic Progress.md note — the guarantee
Before this, nothing wrote the run outcome to
Progress.md(sub-agents only wrote their own step notes; you'd update it by hand). Now the completion path writes every terminal run into the project'sProgress.mdunder a dedicated## Hermes Run Logsection — plain Python, so "done" guarantees a note exists. No LLM in the loop, human-curated sections untouched, newest-first.Entry looks like:
2. Nous-style post-task "learning" — the nice-to-have
On success, a non-blocking background reviewer distills the run's step notes via local Ollama (free — zero Claude tokens, same path as the resume-handoff writer) into:
Learningsentry appended toProgress.md, and~/hermes/skill-candidates/(gitignored) + a Telegram ping to review.Safety: candidates are never auto-installed into
~/.claude/skills(globally active in every Claude Code session) — you promote by hand after reading. An 8B local model's draft is a suggestion, not a live skill. This is the honest version of "self-learning": persisted notes + drafted skills, reviewed before they take effect — same class as the Noushermes-agent, minus the auto-install risk.Refactor
Extracted the shared local-Ollama call into
_ollama_generate(handoff + reviewer both use it).Tests
149 pass / 1 skip (+5): deterministic writer create / append / newest-first / failed-entry, and review-parsing (NO_SKILL vs. skill+name extraction). Local pre-commit still red on the pre-existing
keyring/ruff debt — CI is the gate; committed--no-verify.Deploy
Needs a reload after merge (
launchctl kickstart -k gui/$(id -u)/dev.arbiterai.hermes). Held for your review — not merged.🤖 Generated with Claude Code