Revert drill 2: restore AlitaBot#304
Merged
Merged
Conversation
Szer
added a commit
that referenced
this pull request
Jul 27, 2026
… for SRE-agent validation take 3 (#309) DELIBERATE, OWNER-AUTHORIZED SRE-AGENT VALIDATION DRILL. The owner explicitly authorized taking AlitaBot down again: its only chat is with them, and this re-run specifically validates the six detection-pipeline fixes from #307. Same failure SHAPE as drill 2 (#303, reverted in #304): a hosted BackgroundService (PendingUsageFlushLoop) ticking every 15s via PeriodicTimer, logging Error on every tick, traffic-independent so it fires within verify-deploy.sh's Loki window even though AlitaBot is dormant; plus a throwing Telegram update handler so real messages also fail. Both gated on `not TestMode`. The one thing that's DIFFERENT on purpose: drill 2's every log line contained the literal token SRE_DRILL_RUNTIME_FAILURE plus "deliberate"/"drill"/"must be reverted" — the monitor agent read those words in the log text itself and filed nothing while AlitaBot was completely dead. This drill's runtime log text and exception messages are deliberately disguised as an ordinary application bug instead: - PendingUsageFlushLoop raises via an unguarded `Seq.head` on an empty sequence (System.ArgumentException: "The input sequence was empty."), logged as "Usage flush tick failed while flushing pending LLM usage records" — reads like a forgot-to-check-empty-queue bug in a usage-flush tick, not a drill. - The webhook handler dereferences a null string (System.NullReferenceException: "Object reference not set to an instance of an object."), caught by the existing generic "Unhandled error in update handler for {UpdateId}" log — a completely ordinary NRE. No "drill"/"SRE_DRILL"/"intentional"/"revert" appears in any string literal, log message, or exception text — only in the F# source comments above each throw site, which state prominently and in capitals (for future readers of the diff/commit, not for Loki) that this is deliberate and must be reverted. Gate verified: prod bot_setting.TEST_MODE = 'false' (per #307's binding context); tests/AlitaBot.Tests sets TEST_MODE=true via both the container env var and a seeded bot_setting row (ContainerTestBase.fs lines 34, 87), so the drill code never executes under the hermetic suite. AlitaBot-only (src/AlitaBot/Program.fs), single commit, no BotInfra/other-bot/migration/ Helm/k8s/workflow changes. REVERT IMMEDIATELY AFTER THE DRILL via `git revert` of this commit. Claude-Session: https://claude.ai/code/session_01P41roCWN5Fec7m69sSaunU Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #303. Drill 2 complete — it found four defects, three of them in the monitor/deploy tooling built last night.
1.
verify-deploy.shhas a blind window (most serious)The deploy went GREEN while the new pod was comprehensively broken.
notify-failureandsreboth skipped.Phase 3 queries Loki for the last 2 minutes (
verify-deploy.sh:263), but it runs while ArgoCD is still mid-sync — so it samples the old, healthy pod's logs and passes. The drill's first error landed at11:02:44, after the check had already run.Any failure that manifests during rollout ships silently. Crashloops are caught by Phase 2; runtime bugs — the common case — are not.
Fix needed: sample Loki only after the new ReplicaSet is confirmed Ready, and scope the query to the new pod rather than the container label.
2. The dormant carve-out disables error detection
The monitor agent reported: "
alitaistraffic_class: dormant— rules 3 and 4 (series volume-based rules / emerged-from-zero) are disabled for this bot."But the stats it was handed read:
A z-score of 33.6 was suppressed by a carve-out intended to stop false positives on message-count series. Errors emerging from zero on a dormant bot is precisely the signal that matters.
Fix needed: the dormant carve-out must apply to traffic/volume series only, never to error series.
3. Change correlation suppresses real incidents
"Classification: attributed — the increased error count is plausibly explained by the recent intentional DRILL changes... that makes the observed error volume expected."
A deploy explaining an error burst does not make it benign — it makes it a bad deploy. Attribution currently converts "we know what caused this" into "this is fine".
Fix needed: attribution may explain an anomaly's cause; it must never suppress an error-rate anomaly. A deploy correlated with a new error burst raises severity.
4. The evidence bundle lacks per-group
SourceContext"per-group identifiers and z-scores were not present in the provided Loki grouping output (only counts-only lines)"
Rules 1 (new error group) and 2 (error-group z-score) were therefore unevaluable. §6.1 of the design specifies grouping by
SourceContext+ message prefix; the implementation emits counts only.Program.DrillRuntimeFailureLoopwas a brand-newSourceContextunseen in 28 days — a guaranteed rule-1 hit that could not be seen.Confirmed working
errors: 13, 2 error groupsemerged_from_zero_significant: true🤖 Generated with Claude Code
https://claude.ai/code/session_01P41roCWN5Fec7m69sSaunU