Skip to content

feat(calibration): schedule the satisfaction-floor loosening tick with a one-shot apply alert#8175

Merged
JSONbored merged 1 commit into
mainfrom
feat/loosening-cron-alert
Jul 23, 2026
Merged

feat(calibration): schedule the satisfaction-floor loosening tick with a one-shot apply alert#8175
JSONbored merged 1 commit into
mainfrom
feat/loosening-cron-alert

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Puts Epic: validated auto-loosening for auto-tune.ts's tuning advisor, gated on a clean backtest #8121's loosening loop on the existing cron surface (calibration: schedule the satisfaction-floor loosening evaluation on the cron tick, with an apply alert #8158): a satisfaction-floor-loosening job enqueued hourly as a sibling of the selftune tick, only when SATISFACTION_FLOOR_AUTOTUNE_ENABLED is on — flag-OFF (the shipped default) the enqueued set is byte-identical — with the same defense-in-depth flag re-check in the queue consumer so a stale in-flight job after a flag flip still no-ops.
  • An applied loosening emits exactly ONE structured error-level alert on the established Workers-Logs + Sentry notify path (event: satisfaction_floor_loosened, ev-fingerprinted per the runOpsAlerts convention, carrying both floors and split sample sizes). One-shot by construction: the next tick evaluates from the already-loosened floor and returns no_proposal. The tick itself fails safe — a thrown evaluation is logged (satisfaction_floor_loosening_tick_failed) and swallowed, never poison-pilling the queue.

Closes #8158

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:test
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

The alert carries floors and sample counts only. All autonomy remains double-gated (env flag at enqueue AND dispatch).

UI Evidence

Not applicable — no UI change.

Notes

…h a one-shot apply alert (#8158)

The #8121 narrow start shipped the backtest-gated loosening loop behind a
manual internal trigger only. This puts it on the existing cron surface as a
sibling of the selftune tick: enqueued hourly ONLY when
SATISFACTION_FLOOR_AUTOTUNE_ENABLED is on (flag-OFF the enqueued set is
byte-identical), with the same defense-in-depth flag re-check in the queue
consumer so a stale in-flight job after a flag flip still no-ops.

An APPLIED loosening emits ONE structured error-level alert on the same
Workers-Logs + Sentry notify path runOpsAlerts documents (event
satisfaction_floor_loosened, ev-fingerprinted, carrying the floors and split
sample sizes) -- and cannot re-alert on later ticks by construction, since the
next evaluation starts from the already-loosened floor. The tick itself fails
safe: a thrown evaluation is logged and swallowed, never poisoning the queue.

100% line+branch coverage held on the run module; enqueue gating (on/off/
non-hourly), processor defense-in-depth, one-shot alerting, and both
failure-formatting arms are all pinned.

Closes #8158.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 23, 2026
@JSONbored
JSONbored merged commit 689d3e0 into main Jul 23, 2026
4 checks passed
@JSONbored
JSONbored deleted the feat/loosening-cron-alert branch July 23, 2026 08:24
@JSONbored
JSONbored restored the feat/loosening-cron-alert branch July 23, 2026 08:33
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.

calibration: schedule the satisfaction-floor loosening evaluation on the cron tick, with an apply alert

1 participant