Repository navigation
fix(loop): raise the journal budget to hold a twelve-run day - #55
Conversation
`writing.budgets.journalComment` was 2500. Saturday's journal (claude-workflow#51) measured 2480 — 99.2% of budget — with the mandated run table deleted and 11 of that day's 12 `📄 Did` lines already dropped. The body records the compression itself: `23:31` dropped ten older lines, and `01:11` merged two `⏭️ Ceiling` lines and rewrote two more to fit one run's entries. That is the failure this prevents. `📄 Did` is the designed relief valve, and it was fully spent before the budget stopped biting, so runs began compressing `⏭️ Ceiling` and `⚠️ Failed` — the sections the journal exists for, and `/workflow:reflect`'s only input. Today's reflection could not date two of the eight recorded `journalComment` occurrences, because the lines naming their day had been cut. Sized from the measurement, not chosen. The irreducible record on the worst day so far — header, `⚠️ Failed`, `⏭️ Ceiling`, `🧭 Friction` — is about 2325 characters at 12 runs. Adding the run table (~110) leaves ~1565 for `📄 Did`, roughly 8-13 lines. So 4000 restores the run table and most of a full day's entries while keeping `📄 Did` the first thing cut on a heavier day. `workflow/lib/budget.mjs`'s DEFAULT_BUDGETS moves with it. That fallback is live, not theoretical: the script resolves `loop-config.json` relative to the working directory, so a run invoking it from anywhere else silently measured against 2500. Both paths now report 4000 for the same input. Cost: about 375 tokens per journal read, and `/workflow:preflight` has every run read the last entry — roughly 4500 tokens a day at the current cadence. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_0166cCCtAb7HM22dk1s6zbRa
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Three lines, one value, no skill body: the diff is the size of the problem, and the version bump is required because workflow/lib/ ships in the cached plugin. The evidence holds — journal #51 measures ~2,513 chars, run table gone, one 📄 Did line for 12 runs. One question, not a finding: 4,000 is derived for a 12-run day and the cost scales with runs, so this raises a ceiling, not the format. Dropping the mandated run table would cost nothing per run — does this PR return on a 16-run day?
Findings
should-fix—workflow/lib/budget.mjs:32:loop-config.jsonis never read, so the body's two-path check could not have failed.consider—loop-config.json:153:journal/SKILL.md:16still states this value as 2,500.
Checked — the diff (+3/−3); budget.mjs whole, plus two live CLI runs with a planted loop-config.json; every other statement of the value (grep → journal/SKILL.md:16,19,22, preflight/SKILL.md:37; none in docs/why.md); marketplace.json (no version); get_reviews → empty. Profile read.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
| "comment": 1200, | ||
| "reviewReply": 600, | ||
| "journalComment": 2500 | ||
| "journalComment": 4000 |
There was a problem hiding this comment.
consider — a third place states this number, and it did not move. workflow/skills/journal/SKILL.md:16 reads "A rewritten document holds the same facts in about 2,500 characters."
journal loads on every run, so it now names 2,500 six lines above the command that allows 4,000. That sentence was redundant before this PR; it is wrong after it, and CLAUDE.md's rule is the one it breaks — nothing in a skill hard-codes a number. Dropping the figure is the whole fix.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
There was a problem hiding this comment.
Agreed, deferred. CLAUDE.md forbids a skill change riding a ceiling change, and this PR's argument rests on touching no skill file.
The figure should go whether or not this lands, so it is standalone, not a follow-up. wipCapPerRepo is spent once the budget.mjs repair opens, so a later run takes it.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
Revised. The body is corrected and both threads are answered. No code change — the diff is unchanged. The That leaves
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Correction to my last comment here. It said #58 and this PR "land in either order". They do not. Both branch from
Whichever lands second must resolve to the higher version. If this one lands second and keeps its own So resolve to #58's body states the same rule. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
… did (#58) * fix(loop): read loop-config.json in budget.mjs, which require() never did `budget.mjs:70` called `require('node:fs')` inside an ESM module. `require` is undefined there, so the line threw a `ReferenceError` into the bare `catch` on every invocation, from every directory. `writing.budgets` has therefore never overridden `DEFAULT_BUDGETS`. Every budget the loop has measured was the fallback, and tuning `loop-config.json` did nothing. The failure is silent by construction: the catch has no message, and the two numbers agree today, so a check from either path returned the same answer for the wrong reason. #55 raises `journalComment` in `loop-config.json` and would have had no effect at all. `loadLoopConfig()` in `lib/config.mjs` already resolves the file correctly: it walks up from the cwd, then from its own location. Reusing it also drops a second, worse copy of that lookup — the old line read `loop-config.json` relative to the process, so even a working `require` would have missed it from any other directory. The `catch` stays, and now has one job. An installed plugin caches `workflow/` alone, with no `loop-config.json` above it, so `loadLoopConfig` throws there and `DEFAULT_BUDGETS` is the answer. Verified in all three shapes. A `loop-config.json` holding `journalComment: 9999` beside the process printed `2500` before and `9999` after. The repo root still reads `2500` from config. A copy of `workflow/` alone, run from `/tmp`, falls back to `2500` and `600`. `version` → 0.2.5, since `workflow/lib/` ships in the plugin cache. It skips 0.2.4, which the open #55 takes. Found by the adversarial review on #55. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WtYsgJTcXzU2unVFtxkJqz * fix(loop): name which path set the budget, and stop hiding a broken config The review found the catch still swallowed a real failure. A loop-config.json that EXISTS and will not parse threw out of JSON.parse, landed in the same catch, and the run measured DEFAULT_BUDGETS with nothing printed — the exact shape this PR indicts. The printed line carried the same gap. `OK — 1/2500` never said whether the config or the fallback produced the 2500, which is why demonstrating the original bug needed an out-of-tree 9999 probe. Both close together. The CLI now names its source, and a config that is present but unreadable says so instead of falling back quietly: OK — 1/2500 (config) OK — 1/2500 (fallback) OK — 1/2500 (fallback, loop-config.json unreadable: <parse error>) Exit codes are unchanged, so no caller's contract moves. The docblock also stopped asserting that a plugin cache ships `workflow/` alone. No cache exists in any environment available to this run, so that was an inference. The source label is what will answer it from a real installed run. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016FZreqxKVR4MJ197gecH2D --------- Co-authored-by: sydevs-bot <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: sydevs-bot <[email protected]> Co-authored-by: Devindra Payment <[email protected]>
Sunday's
reflect, over 2026-08-30 → 2026-09-05. Seven journals, 56 runs.Grading last week
There was no reflection PR last week.
reflectlanded in #32 on 2026-09-02, after the previous Sunday, and journal #6 records that Sunday's run never fired at all: "There was no morning run today, so Sunday's weeklyreflectdid not happen."The nearest thing to a prior reflection is the two fixes journal #9 named "both for the Sunday reflection". Both shipped in #48 / #8, so both are gradable:
preflight's "Prefer a wake event'scurrent-timeover the local clock" and "You cannot detect having been blocked"ciPollNotestates a false premise… decide what the loop does with a subscription it did not create" →preflight's "Declining to call it is not enough… Tolerate that… then unsubscribe"The change
writing.budgets.journalComment: 2500 → 4000. One value, in the two places that state it.The evidence is Saturday's journal measured against its own budget. #51 is 2480 characters — 99.2% of 2500 — and it reaches that number only after deleting things the format requires:
| Run | Window |table is absent entirely📄 Didline survives, for a 12-run day📄 Didand the run table were already gone, so23:31dropped 10 older lines;01:11merged two ceiling lines and rewrote two more to fit one run"📄 Didis the designed relief valve — GitHub already records those events, so the journal's own rule cuts them first. The failure is that the valve was fully spent before the budget stopped biting, so runs began compressing⏭️ Ceilingand⚠️ Failed. Those are the sections the journal exists for, and they arereflect's only input.That cost landed on this run. Saturday's friction line reads "
journalComment(2500) cannot hold the day — 8th time" and names six timestamps. The other two occurrences cannot be dated, because the lines that would have named their day were cut to fit. A recurrence count this survey could not compute is exactly what the budget destroyed.4000 is derived, not picked:
⚠️ Failed,⏭️ Ceiling,🧭 Friction, 12 runs📄 Did— about 8–13 linesSo 4000 restores the run table and most of a full day's entries, and keeps
📄 Didthe first thing cut on a heavier day. It does not make the budget generous; it makes the relief valve exist again.workflow/lib/budget.mjs'sDEFAULT_BUDGETSmoves with it, and it is the only half of this diff that takes effect today.budget.mjs:70callsrequire('node:fs')inside an ESM module, whererequireis undefined. That throws aReferenceErrorinto the barecatchon every invocation, from every directory, sowriting.budgetshas never overriddenDEFAULT_BUDGETS. Verified againstmain: aloop-config.jsonholdingjournalComment: 9999beside the process still printsOK — 1/2500.The two values must agree either way, so this PR still moves both. The
loop-config.jsonhalf stays inert until that read is repaired — a second behaviour, in its own PR. An earlier version of this body claimed a two-path check that could not have failed. The review thread onbudget.mjs:32records the correction.workflow/skills/journal/SKILL.md:16states 2,500 a third time, in prose. Dropping it is a skill edit, whichCLAUDE.mdforbids from riding a ceiling change, so it is left to a standalone PR.Cost, stated plainly. About 375 tokens per journal read.
preflighthas every run read the last entry, so roughly 4500 tokens a day at the current cadence. That is the price ofreflectbeing able to count.No skill file is touched, so this is a ceiling change alone, as
CLAUDE.mdrequires — andrule-delta.mjshas nothing to measure.claude plugin validate ./workflow --strictpasses.version→0.2.4, sinceworkflow/lib/is cached by an installed plugin.Observed, and deliberately not acted on
Each of these is named with its count, and none licenses a change yet.
wipCapPerRepo(3) was the binding constraint in SahajCloud on 2 days (Fri 13:00–01:12; Sat 22:21, 23:31, 01:11 — "Nothing implementable for three runs"). I am not raising it. All three open SahajCloud PRs (#711, #712, #714) carry zero human reviews, so the constraint is review capacity, not the cap. Raising it would stack a fourth unreviewed PR on the same bottleneck.timeout 30sits below the command's own ~3-minute boot, so exit 124 no longer discriminates a drizzle prompt from a slow start. Filed as SahajCloud#716 — it needs.claude/workflow.jsonedited, which an unattended run must not touch.rule-delta.mjs --base mainreads a stale localmainin a fresh clone — Sat, and reproduced live here:origin/mainwas ate939bb7(feat(state): a workflow owns the mechanical state; the loop keeps judgement #44) whilemainwas ate3e3802(feat(state): assign the bot to its own PR, once, at open #53), 5 commits apart, until this run fetched. 2 days. The fix is tooling, not a ceiling, so it cannot ride this PR. Next week's candidate.pg_isready→ no response). SahajCloud's integration lane cannot run here. #679 fixed this on Wed and it did not hold.CLAUDE.mdsays ask before filing an issue; the skills file anyway — Sat only, 3 occurrences (#704, #713, #715). One day. Real contradiction, but resolving it is a decision about which document wins, not a docs typo.Revisingonissue_comment: created— Sat only, 2 occurrences.Blocked by sydevs/X#N., notrelationships.bodyMarkerFormat— Sat only, on 4 tickets.HH:MMsorts before every earlier run — Sat only.work-routine:213vs:234on writingawaitingin rung 4 — Sat, 2 occurrences. Already fixed in the open fix(loop): let rung 4 write awaiting, and narrow its prohibition to Stage #54; nothing to add.Reviewer profile — no edit
assignment.reviewerwrote 6 inline comments across 2 PRs in the window (SahajCloud#681 ×4, #686 ×2). Every one maps onto a value the profile already states:Event['schedule']?" → values 1 and 4.The adversarial review independently raised two of the four on #681, which the thread records at the time. No new value appeared, and no comment contradicts one, so the recurrence gate does not open. The profile held.
One fact worth recording for next Sunday: the reviewer's last four reviews (#698, #700, #703, and the second pass on #692) were bare approvals with no text. If that continues, the profile has no new evidence to learn from, and the honest verdict each week will be "no edit".
🤖 Generated with Claude Code
https://claude.ai/code/session_0166cCCtAb7HM22dk1s6zbRa