cyberine rulings: keep the owner rulings file from growing (2026-11-06)
.claude/rules/cyberine-rulings.md loads into every session of a repo, and before this change it only grew: every owner decision stayed in it forever unless the owner reverted it. A test repo reached 30 rulings and 11 KB in three weeks, about a third of them one-shot choices ("build X now", "one live session for tasks A, B, C") whose task was long done. The file is now derived from the board journal as the owner rulings that still bind work: two new decided statuses, retired (one ref) and consolidated (several refs plus one rewritten ruling), take lines out of the rendered file while the journal keeps every original, and cyberine tasks decide --revert <ref> on a retire or a consolidation brings the originals back. The render also drops boilerplate: a leading "Owner: decide" in the title, a reason that only restates "Owner ", "reversible by one revert", trailing punctuation; a footer says how many rulings are retired or merged.
Run recipe:
cyberine rulingslists the active rulings with their refs, the rendered size and the budget;--alladds the retired and merged ones;--jsonprints{ bytes, budget, active, retired?, merged? }. Free, no model.cyberine rulings consolidateis the one-command clean-up, A-Z in one invocation. Each round sends one prompt to the first worker of the active fleet that answers (the same first-that-answers pick ascyberine draft), carrying every active ruling with a short key, its task ids, whether its task is done and, for a done one, anevidence:line: up to three commitsgit log --grep=<task id>finds in the board root plus the task'sdoneevidence, ornone. When the file is over budget the prompt says so and asks for every qualifying retire; a one-time grant (unseal and rebuild a check, run a suite once, lift a test ban on named files, work for "a fresh session") whose task is done and whose evidence shows the work landed counts as one-shot. The worker returns a JSON plan of retires and merges. Cyberine then validates every action without a model: the key exists and is used once; a retire needs a "residual" sentence saying why no constraint remains AND every task of the ruling must have adonejournal event AND the ruling must have evidence (the retired event records it in itsevidencefield), so a ruling on open work never leaves the file whatever the model says; a merge needs at least two keys, a choice and a reason, and must be shorter than its sources. Invalid actions are printed asskipped:lines and the valid ones are appended under the board lock (bycyberine-rulings/<worker>); a ledger that changed while the worker answered writes nothing for that round. Rounds repeat until the rendered rule is underCYBERINE_RULINGS_BUDGET_BYTES, a round retires and merges nothing, or 5 rounds ran. It prints before/after counts and bytes, the rounds, and oneundo: cyberine tasks decide --revert <ref> --reason "<why>"line per action. The last line isrulings: under budget (<bytes> of <budget> bytes) after N round(s)., orrulings: over budget after N round(s): ...followed by one line per active ruling that keeps it over and the next step (the owner rewrites or reverts a standing ruling, or raises the budget; after the round cap, one more run continues).--dry-runruns one round, prints the plan and writes nothing (it still spends the worker turn);--jsonprintsrounds,stopped(under-budget,no-change,round-capordry-run),underBudget,standing(the active rulings when still over budget), the plan with aroundper action, the written refs and the rule action. A second run that finds nothing prints "nothing to consolidate" and writes nothing but the run note. Known limit: the evidence is a text search for the task id, so a commit that names the id without doing the work counts too; the worker and the owner'sundo:line are the backstop.cyberine rulings retire <ref|task-id> --residual "<one sentence why no constraint remains>" [--yes|--dry-run] [--json] [--by <who>]retires one finished one-shot ruling by hand, with no model turn, for a ruling consolidate's model kept. The target is an exact ruling ref, else a task id found in exactly one active ruling (an unknown or ambiguous id, or a ruling already retired, merged or reverted, is refused and names the candidates or the state). The same checks as consolidate apply: a non-empty residual, every task of the ruling has adonejournal event, and evidence exists (a commit search for the task id in the board root plus the done evidence); one more guard consolidate leaves to the model: a ruling whose title or choice mentions security, consent, privacy, permission, credential, password, secret, token, data-handling or policy wording is refused with a pointer tocyberine tasks decide --revert. It appends onedecidedevent with statusretired(bycyberine-rulings/manualunless--byis given) under the board lock and printsretired <ref> (<ids>): <choice>, the residual, the evidence andundo: cyberine tasks decide --revert <ref> --reason "<why>"; the retired ruling shows undercyberine rulings --all. It writes only on a confirmation (owner answer 2026-11-08): without--yesit previews first, then on a terminal asksRetire this ruling? [y/N], and anywhere else (a Claude Code session, a script) writes nothing and prints the exact--yescommand to confirm with;--yeswrites at once, for when the owner's own message already names the ruling to retire.--dry-runonly previews and is refused together with--yes. The reason is left out of the policy-word check because it often cites the decision policy as its justification.--jsonprints{ retired: { ref, ids, residual, evidence }, written, rule }(a preview addsdryRun: true,needsConfirmandconfirm), or{ refused }with exit 1. In Claude Code, "cyberine retire ruling " or "bo ruling X da xong" runs it through thecyberine:tasksskill.- In Claude Code, "cyberine consolidate rulings", "cyberine don rulings" or "gom rulings cyberine" runs it through the
cyberine:tasksskill. - Budget per repo: set
"rulings": { "budgetBytes": 16000 }in.cyberine/config.local.json(this machine) or.cyberine/config.json(tracked) to raise the budget for one repo without touching the machine-wide~/.cyberine/.env. Precedence: theCYBERINE_RULINGS_BUDGET_BYTESenv var (a positive number), thenconfig.local.json, thenconfig.json, then 8000; a value that is not a positive number falls through to the next source.cyberine rulingsprints where the budget came from (budget 16000 from config.local.json) and--jsonaddsbudgetSource.cyberine config set rulings.budgetBytes 16000 --localwrites it (--projectforconfig.json;--globalis refused because~/.cyberine/config.jsonis not read for this key, the machine-wide value stays the env var) and says when the env var orconfig.local.jsonstill overrides what it wrote;cyberine config get rulings.budgetBytesprints the effective budget and its source. - Nudge: when the rendered rule passes
CYBERINE_RULINGS_BUDGET_BYTES(default 8000),cyberine tasks decide --status ownerandcyberine syncprint one line naming the size andcyberine rulings consolidate, and the SessionStart board banner adds[rulings] <N> active, <bytes> bytes, over the <budget>-byte budget -> say "cyberine don rulings". Every real consolidate run (one that found nothing too) journals arulings consolidatenote with the rendered size, and the nudge stays quiet until the file has grown by a quarter of the budget past that size, so a set of rulings that are all standing constraints is not nagged about on every decide or session start. The banner line is computed from the journal on every uncached render; the banner cache keys on the journal files and the repo's two.cyberineconfig files, so a change ofrulings.budgetBytesshows on the next session start while a change ofCYBERINE_RULINGS_BUDGET_BYTESalone shows on the next journal write. Detection is free and automatic; the consolidation itself only runs when asked, because it spends a worker turn and changes what sessions obey.
Measured on the test repo (2026-11-06, dry run, claude-ft): 30 active rulings, 10394 bytes after the boilerplate render; the plan retired 7 finished one-shot rulings and merged 3 refinement pairs (6 rulings into 3), leaving 20.
Known Limitations and Deferred Work: there is no record-time once|standing label (an advisor panel ruled it would be mislabelled before the outcome is known; "task done" filters retire candidates instead). A retire or merge is the agent's reversible choice under the decision policy, so it applies without an owner confirmation; the owner reviews it through the printed undo lines and cyberine rulings --all. The budget nudge does not appear in the SessionStart board banner yet. The validation cannot prove a merged ruling kept every nuance of its sources; only reading it can. The keyword guard of retire is a plain word list, so a policy ruling worded without those words is not caught; the evidence is the same task-id text search as consolidate. Regression smokes: npm run selftest:rulings-consolidate (fake worker, no quota) and npm run selftest:rulings-retire.
cyberine sync: bring a repo to the current Cyberine (kpwxe, 2026-10-31)
Run recipe: cyberine sync in any repo that applied the Cyberine rules. It refreshes generated rule text (the Acceptance checks and Verification sections, when they still hold an older Cyberine...
cyberine notice: scoped owner rulings, knowledge and plans at session start (2026-11-10)
A full rulings file loaded into every session and grew without bound, and Claude Code saves hook output over 10,000 characters to a file without telling anyone. Since k8380 (owner ruling D7-A) a...