Skip to content

orb(observability): invariant — every decision or non-decision records a named reason; no silent gates on dispatch paths #9003

Description

@JSONbored

Invariant

Every decision — and every non-decision — must record a reason. A pass that declines to review, declines to act, downgrades, defers, or drops work must emit an audit event (and, for error paths, PostHog capture) naming the specific gate that made the call. "Nothing happened and nothing says why" must be structurally impossible.

This came out of the 2026-07-26 restart investigation, where the concrete instances cost hours of reverse-engineering by elimination:

What to build

  1. Typed reasons, not bare booleans, on gate functions. Any function that can suppress a review/action (shouldStartAiReviewForAdvisory, shouldRequirePublicAiReviewForAdvisory, eligibility/reputation/skip resolvers, freeze checks, etc.) returns { decision, reason } instead of boolean, and the caller audits the reason on the suppress path. A bare-boolean gate on a dispatch path should fail a lint/unit convention test, the same way no-direct-octokit enforces the write chokepoint.
  2. One audit event per suppressed lane per pass, bounded-cardinality reason codes (fits the existing loopover_agent_disposition_total labeling approach), so dashboards can show "reviews suppressed by reason" over time.
  3. Error-path instrumentation completeness pass: every .catch(() => undefined) / .catch(() => null) on a decision-relevant path either records an audit event or a PostHog capture before swallowing. A swallowed error that changes behavior (e.g. cache read failure → treated as miss) is itself a decision and needs a reason event at least at debug/counter level.
  4. Audit-coverage test pattern: for the main publish path, a test that runs a pass with each gate forced to suppress and asserts a reason event was recorded — so a future silent branch can't be added without failing a test.

Acceptance

  • For any PR pass in the audit trail, one can answer "why did/didn't the AI review run, and why did/didn't an action execute" from audit_events alone, without reading code.
  • CI enforces the typed-reason convention on the dispatch paths.

Related: #9000 (concrete silent-skip instance), #8997/#8998/#8999 (the investigation that surfaced this).

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions