feat(loop): loop.md re-read on fire + trailing every clause (0.8.1) - #25
Merged
Conversation
…arsing (0.8.1)
v0.9.0 stage of the Claude Code alignment report, released as 0.8.1:
- File-backed maintenance tasks (bare /loop with a project or user-level
loop.md) now record loopFilePath + lastContentHash and re-read the file
at fire time: edited content is injected in full and the hash
persisted; unchanged content gets a short cache-friendly reminder; a
deleted file turns the tick into a no-op. Snapshot maintenance tasks
without loopFilePath are unaffected.
- extractInterval() now deterministically extracts a trailing "every"
clause ("check the deploy every 20m", "every 5 minutes") as a fixed
interval when the leading token isn't one — "check every PR" does not
match and stays Adaptive. Word units (seconds/minutes/hours/days) map
to s/m/h/d via the same parser, so the 1s minimum applies uniformly.
190/190 tests pass. Verified against a real opencode serve: trailing
every created a fixed 20s task that ran immediately; loop.md edits were
injected in full on the next fire, unchanged content got the short
reminder, and deleting loop.md produced a no-op tick.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Implements the v0.9.0 stage of the Claude Code alignment report (released as 0.8.1):
/loopwith a project.opencode/loop.mdor user-level~/.opencode/loop.md) now recordloopFilePath+lastContentHash. At fire time the file is re-read: edited content is injected in full (hash persisted), unchanged content gets a short cache-friendly reminder, and a deleted file turns the tick into a no-op. Legacy snapshot maintenance tasks are unaffected.extractInterval()deterministically extracts... every 20m/every 5 minutes(Claude Code rule 2) as a fixed interval when the leading token isn't one.check every PR(no time expression) stays Adaptive. Word units map to s/m/h/d through the same parser, so validation (1s minimum) is uniform.Test plan
npm test— 190/190 (new trailing-every parser cases, every-clause task creation, maintenance re-read: unchanged/edited/deleted)opencode serveE2E:/loop 回答:5+5等于几 every 20s→ fixed 20s, prompt extracted verbatim, executed immediately/loop→ maintenance task withloopFilePath; editing loop.md → next fire injected the full new content (hash updated); unchanged → short reminder; deleting the file → no-op tick (no injection)🤖 Generated with Claude Code