Skip to content

[38349903] Base-red incident service: detect, own, close, clear - #1422

Merged
roboco-app[bot] merged 11 commits into
feature/backend/14c9875a--08e4d6c4from
feature/backend/14c9875a--08e4d6c4--38349903
Nov 5, 2026
Merged

roboco-app[bot] merged 11 commits into
feature/backend/14c9875a--08e4d6c4from
feature/backend/14c9875a--08e4d6c4--38349903

Conversation

@roboco-app

@roboco-app roboco-app Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Goal: when the integration base branch's CI is red, open exactly one P0 base-red incident with a single owner, and close it when green. Context from intake: PR #1158 (no Python changes) failed 'Python quality gate' and 'Entire Gates' because the base was red; the $119.39 task 'Fix ruff-format violation in release-certificate doc (CI Python quality gate red)' was opened for the same cause; devs resubmitted unchanged heads (d6a26717).

Build in roboco/services (new module, e.g. base_red_incident.py; services own DB writes and side effects, routes stay thin, respect .roboco/conventions.yml placement):

  • Incident model + Alembic migration (project_id, base_branch, status open/closed, owner_task_id, owner_agent slug, opened_at, closed_at, consecutive_red count, closed_reason/cleared_by). At most one open incident per project+base (unique partial index or equivalent).
  • Detection: read the CI check state of the base branch HEAD by REUSING the existing CI-status plumbing (roboco/services/git.py e.g. _resolve_ci_head_sha and the forge/* providers, plus ci_watch_engine.py); do not add new HTTP clients. Open an incident only after N consecutive red readings (configurable, default 2-3); close on the first green reading after open; avoid flapping (pending/unknown readings neither count as red nor close). A CI lookup error must fail open (no incident opened, no gate), logged.
  • Ownership: one named owner when opened (the fix task, or the agent/cell that owns it). Create or record the owner's fix task id and send a formal notification to the owner so other cells do not rediscover the failure.
  • Public interface that the gate leaf consumes (keep these signatures exactly): async get_open_incident(project_id) -> BaseRedIncident | None (exposes owner_task_id, owner_agent, base_branch, opened_at); async is_owner_task(task_id) -> bool; async clear(project_id, cleared_by: str, reason: str) -> BaseRedIncident | None (manual clear path, audited).
  • Wire the periodic check into the existing engine/loop (ci_watch) rather than a new scheduler, and expose a thin manual-clear route only if an existing admin route pattern fits.
  • Tests (80% coverage on new code): opens only after consecutive reds, single incident, closes on green, no flapping on pending, fail-open on lookup error, clear().
    Run make gate / make quality before submitting.

@github-project-automation github-project-automation Bot moved this to Backlog in RoboCo Kanban Nov 3, 2026
@github-actions github-actions Bot added area: services Touches roboco/services/ (business logic, side effects) area: db Touches roboco/db/ or roboco/models/ area: alembic Touches alembic/ (database migrations) tests Test suite changes labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request on RoboCo!

Quick checklist before review (most of these are enforced by CI, but worth a glance):

  • make quality — ruff format check, ruff check, mypy, pytest (≥80% coverage), and the rest of the gate
  • Panel changes pass pnpm lint and pnpm exec tsc --noEmit (run from panel/)
  • No # noqa / # type: ignore shortcuts; pre-existing violations in touched files are fixed
  • Added an entry under ## [Unreleased] in CHANGELOG.md
  • Signed the CLA (the bot will prompt you on this PR)
  • Signed your commits — master requires verified signatures (SSH signing setup)
  • Updated any affected docs under docs/

See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow.

Welcome aboard — a maintainer will review shortly.

@github-actions github-actions Bot added documentation Docs, README, CHANGELOG, governance files area: panel Touches panel/ (Next.js control panel) area: agents Touches agents/ (prompts, role config) labels Nov 4, 2026
…facts to base

Entire-Checkpoint: 01M6KTMM1DG88MVK0MGS5EHW87
@github-actions github-actions Bot removed area: panel Touches panel/ (Next.js control panel) area: agents Touches agents/ (prompts, role config) labels Nov 4, 2026
@github-actions github-actions Bot added area: panel Touches panel/ (Next.js control panel) area: agents Touches agents/ (prompts, role config) labels Nov 4, 2026
@github-actions github-actions Bot removed area: panel Touches panel/ (Next.js control panel) area: agents Touches agents/ (prompts, role config) labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

The automatic codegen ran with the clone root's old code (the worktree
import hook missed .venv-<digest>, fixed in #1524) and committed drift
to these generated files. This branch changes no generator source, so
they now match the base branch byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rennf93
rennf93 force-pushed the feature/backend/14c9875a--08e4d6c4--38349903 branch from afa967b to f04f581 Compare November 4, 2026 23:37
@roboco-app
roboco-app Bot merged commit d29b852 into feature/backend/14c9875a--08e4d6c4 Nov 5, 2026
14 of 15 checks passed
@roboco-app
roboco-app Bot deleted the feature/backend/14c9875a--08e4d6c4--38349903 branch November 5, 2026 04:17
@github-project-automation github-project-automation Bot moved this from Backlog to Done in RoboCo Kanban Nov 5, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: alembic Touches alembic/ (database migrations) area: db Touches roboco/db/ or roboco/models/ area: services Touches roboco/services/ (business logic, side effects) cell/backend documentation Docs, README, CHANGELOG, governance files tests Test suite changes to feature/backend/14c9875a--08e4d6c4

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant