mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-03 22:57:01 +01:00
main
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0b05ebb74b |
fix(ai): no box timer or background path spends the shared free AI tier (#897)
* fix(ai): no box timer or background path spends the shared free AI tier Removes the frontier-digest, feedback-digest and scout-events cron routes and timers; the digest email is built without a model; check-model-ids no longer sends a one-token completion per pinned model; the DoD model judge on run close (page poll / runner push / cron sweep) is gone - precheck only; the Today Watch nudge composes on click, rate-limited, not on mount; the loki-e2e check (a real chat turn 4x/day) is on demand only; standing-rule calendar bookings never call the model to recover a date. scripts/test/no-free-background-ai.ts walks the call graph from every cron route and close path and fails if any reaches a model endpoint. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> * fix(ai): delete the scout and feedback-digest producers the removed crons left dead Also lowers the telemetry monitored-path floor to 2: frontier_digests was demoted on purpose with its cron. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> --------- Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
caa0e41c3b |
chore: add a formatter (#449)
* chore: add a formatter, matching the style this repo already writes singleQuote=false was chosen by counting this repo's own imports, not by fleet decree. The fleet is genuinely split and the two repos that already had a .prettierrc disagreed with each other, so there was no standard to restore. Quote style does not cross repo boundaries; having a gate does. Markdown is ignored for now — prettier rewraps prose, which would bury the real diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * style: format with prettier (1062 files) Mechanical. No behaviour change. This SHA is listed in .git-blame-ignore-revs so `git blame` skips it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * chore: teach git blame to skip the reformat Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(lint): reattach two guards the reformat detached Both effects were one-liners, so a trailing eslint-disable-line covered the setState call: useEffect(() => { setSelected(new Set()); }, [q.length]); // eslint-disable-line ... prettier expanded the block. The comment stayed on the closing line while the call moved above it, so the guard protected nothing and the rule its author had deliberately silenced failed the build. This is the second shape of the same defect — hirnli had the eslint-disable-NEXT-line variant. Both come from the same fact: an eslint directive binds to a line number, so reformatting can silently unbind it, which makes 'mechanical, no behaviour change' false for any bulk reformat. * chore(desktop): bump the runner version the reformat requires desktop-release-drift enforces that anything built into Fleet Runner which differs from the last released tag must carry a version ahead of that tag — main read 0.8.15 and fleet-runner-v0.8.15 already shipped. A whole-repo reformat changes bytes under desktop/, so the gate fires. The alternative was adding desktop/ to .prettierignore, which would buy a quiet PR by carving a permanent hole in the formatter's coverage — the precise shape of silent drift this test was written to catch. Bumping is what the rule asks for and costs one patch release whose only content is whitespace. * chore: merge main and re-format A whole-repo reformat conflicts with any concurrent commit, and a conflicting PR runs no checks at all while reporting nothing. Conflicts resolved to main, which is correct because this branch changes formatting and nothing else. * chore: leave desktop/ out of this reformat desktop-release-drift is right to refuse this. Everything under desktop/ is built into Fleet Runner, so changing it means shipping: bump the version AND add a FLEET_RUNNER_RELEASES entry, whose stated audience is 'person who installed Fleet Runner and wants to know what changed'. For a whitespace-only build the honest answer is 'nothing', so that release should not exist — and I should not write release notes claiming otherwise. I had bumped to 0.8.16 to get the gate green. That was the wrong direction: publishing a build to three OS runners to keep a formatting PR quiet. Reverted. desktop/ is excluded in .prettierignore with the reasoning recorded there, to be formatted alongside the next real runner change, where the bump and the notes are true anyway. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
d3f55225d3 |
fix(signals): three checks that reported something other than what they measured (#402)
* fix(crons): a scheduled job that records nothing cannot be diagnosed The frontier self-improvement loop ran from 2026-06-24 to 2026-08-27 and surfaced zero proposals. A taxonomy shipped on 2026-08-25 to say WHY — dead model / unreadable reply / model found no match / everything deduped — and it worked: the first night it ran it answered "unparseable". That answer was going to expire the next morning. The outcome existed only in the HTTP response body, which fc-cron.sh echoes into the systemd journal, and this box's journal is size-capped with no time limit: the frontier-digest unit holds about ONE day. Sixty-four nights of evidence about the loop had already been discarded one day at a time, which is why "drafted: 0" was all anyone could ever recover. Two of eighteen cron-authed routes persisted nothing. The other sixteen already used logDebug, so this conforms to the convention rather than inventing one — and it is the right sink because prune-debug-logs keeps error rows 90 days and info/warn 30, so the runs worth a postmortem are the ones that survive to have one. - frontier-digest logs generation outcome, drafts, surfaced, judge failures and panel reachability, at a level that separates a fault in the machinery (dead model, unreadable reply, panel never voted) from the loop working as designed (no match today). Both used to end in the same drafted: 0. - send-digest-emails logs its send results. It catches per-user failures so one bad address cannot stop the batch, which also means every send could fail while the route answered ok: true and systemd recorded a success. - generateProposals now returns rawSample on "unparseable". Without the text, "unparseable" is the same which-of-several-causes question one level down: a refusal, a prose preamble and a truncated object all fail to parse and each needs a different fix. Also normalises the log source to crons/<name>. Twelve routes used that and five used api/crons/<name>, so a query for cron activity silently returned about two-thirds of it. Nothing filters on source today, so this is hygiene rather than a live bug — but it was a wrong answer waiting for the first person to ask. The gate closes the class rather than the two instances: every route demanding requireCronAuth must call logDebug under its own source name. Comments are stripped before matching, the match is call-shaped so an import cannot satisfy it, and a floor fails the scan if it stops finding routes. Proven by six mutations, each red then green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P * fix(signals): three checks that reported something other than what they measured Last week this app produced 231 warnings. 216 of them meant "nothing happened", and six real errors sat underneath — a telemetry sensor dead for 78 days, a runner two versions behind, an email probe timing out. A channel degrades to the reliability of its worst entry, and the rational response to a mostly-wrong list is to stop reading it. Three separate causes, one shape: the signal was not attached to the thing it claimed to describe. 1. The pre-commit hook lints nothing, and says so reassuringly. GLOBS was unquoted, so the SHELL expanded "src/**/*.ts" before git saw it — and POSIX sh has no globstar, so ** collapsed to one level. The variable became 230 literal paths, all exactly two levels deep, and nothing deeper could ever match. Almost all code here is deeper. Measured on a commit touching 10 TypeScript files: it matched 0 and printed "no staged TypeScript — nothing to lint", which is a statement about its own pathspec wearing the clothes of a statement about the commit. ':(glob)' does two jobs: it makes ** mean "any depth" to git, and since no file can be named ':(glob)…' the unquoted expansion stays literal. Reach goes from 230 shallow paths to 1147 files, 905 of them deeper than two levels. verify still runs in full on pre-push and in CI, so nothing unlinted reached origin. What was lost is the fast local loop the hook exists for. 2. The env checker read a different variable than the app. checkEnv() tested the bare TELEGRAM_CHAT_ID; every consumer reads it through envAlias, which looks only at APP_/FLEETCROWN_/COCKPIT_ and never the bare name. Wrong in both directions: - false alarm — prod has APP_TELEGRAM_CHAT_ID set and delivery works (confirmed live with a read-only getChat), yet it warned at every boot: 48 of the week's 231 warnings. - false quiet — and the message told the operator to set TELEGRAM_CHAT_ID, which silences the warning while selfTelegramTarget() still returns null and every notification still vanishes. A fix that removes the signal and not the fault is worse than no check. The message now names the prefixed variable that actually works. 3. check-pending-approvals warned about the world, hourly. It warned whenever a stale approval existed — a fact about the world, and the world does not change hourly. 168 identical warnings in seven days, every one with expired/raised/pinged/cleared all zero. The state is not lost: an open pending_approvals alert already represents an ongoing condition once instead of sixty-eight times. The alert records what is true; the log records what happened. Gates, both derived from source rather than a list, six mutations each red then green: the pathspec test is behavioural — it re-runs the hook's own assignment in the hook's own shell and asks git what it matches, so it stays honest however the line is rewritten, where a grep for ':(glob)' would only prove today's spelling. The env test derives the rule: whatever the app resolves through envAlias, the checker must too. No gate for (3). "Log level reflects work done, not state observed" is a real class, but every static check I could write for it produces false positives on jobs whose work IS an observation. Verified by watching the warn rate in prod instead, and left un-encoded deliberately rather than silently. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P --------- Co-authored-by: t <t@t.t> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |