Skip to content

docs(spec): SLO spec matches shipped defaults (7d reliability, 50-sample minimum, customer-failure exclusion) (agent:clawd) - #56

Merged
TargiX merged 3 commits into
mainfrom
clawd/signalops-slo-spec-sync
Nov 3, 2026
Merged

TargiX merged 3 commits into
mainfrom
clawd/signalops-slo-spec-sync

Conversation

@TargiX

@TargiX TargiX commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

What

docs/specs/signalops-slo-incidents-v1.md still described the pre-#55 contract. This syncs the spec with what actually shipped in 60edbe8 + ec6851a (PR #55):

  • Operation reliability default minimum sample: 20 → 50 terminal operations (code default minimumSample: 50, windowMinutes: 10_080).
  • Documents that reliability is judged over a rolling 7-day window and why (a 99% objective cannot be told apart from 95% on a few dozen operations).
  • Documents the customer-caused failure exclusion (content policy, invalid input) from the reliability sample; totals.successRate keeps the raw outcome rate.
  • Documents per-policy evaluation windows: reconciliation delta ratio also 7 days, everything else 24 hours, signal freshness 60 minutes; the incident evaluator judges each enabled SLO on the snapshot covering its own window (sloRangeForWindowV1), while provider/telemetry/capacity decisions always read 24h; cockpit display evaluation widens the window until the minimum sample is met.

Docs-only change; no code, no migrations, no API surface touched. Every claim in the paragraph was checked against src/lib/signalops/v1/slo.ts (DEFAULT_POLICY_TEMPLATES, sloRangeForWindowV1) and src/lib/signalops/v1/incidents.ts (window-scoped snapshot judging).

Verification

  • Claims cross-checked line-by-line against slo.ts defaults and incidents.ts snapshot selection.
  • prettier --check on the file: the only findings are pre-existing table-alignment style on main (no format job in CI); no new violations from this change.

agent:clawd

Summary by CodeRabbit

  • Documentation
    • Updated the default reliability objective to require 50 terminal operations instead of 20.
    • Specified rolling 7-day evaluation windows for reliability and reconciliation delta ratio, a 60-minute window for signal freshness, and 24-hour windows for other policies.
    • Clarified that policies below their minimum sample are marked as insufficient data and do not open incidents. Cockpit displays may widen the window to find enough data, or show the widest populated window with a low-sample indicator; this does not affect incidents.
    • Clarified that customer-caused failures are excluded from the reliability ratio, while the displayed success rate remains unadjusted.

…days at 50 samples, customer-caused failures excluded, each SLO judged on its own window
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
signalops Ready Ready Preview Nov 3, 2026 5:22am UTC

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 95 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 94677342-ce33-4253-b677-8e4dd9e98dd2
Commits

Reviewing files that changed from the base of the PR and between d14eca6 and 68736ef.

Files selected for processing: 2
  • scripts/test-signalops-postgres-v1.mjs
  • supabase/migrations/20261103000000_signalops_v1_reliability_default_7d.sql
Walkthrough

The specification raises the Operation reliability minimum sample to 50 terminal operations and defines policy evaluation windows and snapshot handling. The migration updates eligible existing policy rows and provisions new workspaces with the revised reliability defaults. The PostgreSQL test checks the new default values.

Changes: Reliability defaults and evaluation

Layer / File(s) Summary
Evaluation rules and reliability defaults
docs/specs/signalops-slo-incidents-v1.md, supabase/migrations/20261103000000_signalops_v1_reliability_default_7d.sql, scripts/test-signalops-postgres-v1.mjs
The specification sets the reliability minimum sample to 50 and defines policy-specific windows, snapshot selection, and Cockpit sample handling. The migration updates matching existing operation-success-rate rows and seeds new workspaces with a 50-operation minimum and a 10,080-minute window. The test asserts these defaults.
Workspace provisioning function
supabase/migrations/20261103000000_signalops_v1_reliability_default_7d.sql
The replacement function validates provisioning inputs, returns an existing active tenant when one is found, or creates a tenant, owner membership, policy rows, and audit record.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • TargiX/Signalops#55: Implements operation-reliability behavior that this PR documents and provisions, including the 50-operation minimum and 7-day window.
  • TargiX/Signalops#53: Adds the reconciliation delta ratio SLO, which this PR documents as using a 7-day evaluation window.
Merge Risk: Moderate · previous review d14ec

The migration changes the reliability rule for existing workspaces but keeps the old policy version. A breach that spans the migration can therefore stay attached to an already acknowledged incident, and operators receive no new alert under the revised rule. Assign a new version to migrated and newly provisioned rows before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the spec change (7-day reliability window, 50-sample minimum, customer-failure exclusion), which matches the docs spec change in the summary and objectives. However, the changeset also…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the spec change (7-day reliability window, 50-sample minimum, customer-failure exclusion), which matches the docs spec change in the summary and objectives. However, the changeset also includes a new migration that changes shipped defaults and rewrites the provisioning function, plus a PostgreSQL test. The title describes only the documentation side and does not mention these behavioral changes, so it is only partially related to the full changeset. The title is also long (123 characters) and includes a bracketed agent tag, which goes against the concise-title guidance.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: d7441d61-e917-4a1b-815a-52d6d2ef18c5
Commits

Reviewing files that changed from the base of the PR and between ff13d3f and d14eca6.

Files selected for processing: 3
  • docs/specs/signalops-slo-incidents-v1.md
  • scripts/test-signalops-postgres-v1.mjs
  • supabase/migrations/20261103000000_signalops_v1_reliability_default_7d.sql

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

…nt config

CodeRabbit on PR #56: the spec claims a 50-operation / 7-day reliability
default, but rows materialized by 20260824011500 and the provisioning
function still held 20 / 1,440, and stored rows override the code
fallback at read time.

- new migration updates only untouched legacy default rows (version-
  scoped predicate preserves tenant-customized policies)
- provisioning function replaced so new tenants get 50 / 10,080
- spec: scope the insufficient_data rule to incident evaluation and
  document the Cockpit display-only widest-window lowSample fallback
- postgres test: register the migration and assert provisioned defaults

Verified: pnpm test:postgres:v1 equivalent (test-signalops-postgres-v1.mjs
against a loopback postgres:16) passes. [agent:clawd]

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

… rows (agent:clawd)

CodeRabbit major follow-up on the d14eca6 default migration: the migration
updated 20/24h rows to 50/7d while keeping version operation-reliability-2026-08-24,
but the shipped code default (src/lib/signalops/v1/slo.ts) is
operation-reliability-7d-2026-10-27, and incident identity is
(tenant, metric, route scope, policy version). Keeping the old label would let
incident sync reuse a pre-migration incident, retain its acknowledgement, and
skip the opening alert for the revised rule.

- guard migration now sets version operation-reliability-7d-2026-10-27 on the
  untouched legacy rows it updates;
- replacement provisioning function inserts the same revised version so new
  tenants match the code default;
- postgres migration test asserts the provisioned version alongside
  sample/window.

Verification: node --check, eslint, tsc, next build all green locally.
@TargiX
TargiX merged commit f27b879 into main Nov 3, 2026
4 checks passed
@TargiX
TargiX deleted the clawd/signalops-slo-spec-sync branch November 3, 2026 18:17

This branch was successfully deployed

1 active deployment
Preview — 68736ef8 Deployed Nov 3, 2026 by vercel[bot]
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.

2 participants