Skip to content

Revert drill 2: restore AlitaBot#304

Merged
Szer merged 1 commit into
mainfrom
revert/sre-drill-2
Jul 27, 2026
Merged

Revert drill 2: restore AlitaBot#304
Szer merged 1 commit into
mainfrom
revert/sre-drill-2

Conversation

@Szer

@Szer Szer commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Reverts #303. Drill 2 complete — it found four defects, three of them in the monitor/deploy tooling built last night.

1. verify-deploy.sh has a blind window (most serious)

The deploy went GREEN while the new pod was comprehensively broken. notify-failure and sre both 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 at 11: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: "alita is traffic_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:

log_errors_24h: current=13  median_28d=0  z_score_28d=33.59
emerged_from_zero=true  emerged_from_zero_significant=true

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.DrillRuntimeFailureLoop was a brand-new SourceContext unseen in 28 days — a guaranteed rule-1 hit that could not be seen.

Confirmed working

  • Gatherer recorded the truth: errors: 13, 2 error groups
  • Statistics were correct: z=33.59, emerged_from_zero_significant: true
  • Change correlation retrieved both git merges and ArgoCD deploy history
  • Owner sent 2 messages, both logged with full TraceIds, no reply — user-facing outage proven

🤖 Generated with Claude Code

https://claude.ai/code/session_01P41roCWN5Fec7m69sSaunU

…r SRE-agent validation, take 2 (#303)"

This reverts commit 6100a4b.
@Szer
Szer merged commit 086e21e into main Jul 27, 2026
4 checks passed
@Szer
Szer deleted the revert/sre-drill-2 branch July 27, 2026 11:15
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>
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.

1 participant