Skip to content

feat(loop): loop.md re-read on fire + trailing every clause (0.8.1) - #25

Merged
jkrandom-sudo merged 1 commit into
mainfrom
feat/loop-reread-every
Aug 6, 2026
Merged

feat(loop): loop.md re-read on fire + trailing every clause (0.8.1)#25
jkrandom-sudo merged 1 commit into
mainfrom
feat/loop-reread-every

Conversation

@jkrandom-sudo

Copy link
Copy Markdown
Owner

Summary

Implements the v0.9.0 stage of the Claude Code alignment report (released as 0.8.1):

  • loop.md re-read on every fire: file-backed maintenance tasks (bare /loop with a project .opencode/loop.md or user-level ~/.opencode/loop.md) now record loopFilePath + 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.
  • Trailing "every" clause: 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)
  • Real opencode serve E2E:
    • /loop 回答:5+5等于几 every 20s → fixed 20s, prompt extracted verbatim, executed immediately
    • bare /loop → maintenance task with loopFilePath; 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

…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>
@jkrandom-sudo
jkrandom-sudo merged commit 638188c into main Aug 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant