Skip to content

fix(review): break Gittensory Gate self-deadlock + guardrail flood-hardening - #1099

Merged
JSONbored merged 2 commits into
mainfrom
feat/guardrail-flood-hardening
Jun 23, 2026
Merged

fix(review): break Gittensory Gate self-deadlock + guardrail flood-hardening#1099
JSONbored merged 2 commits into
mainfrom
feat/guardrail-flood-hardening

Conversation

@JSONbored

@JSONbored JSONbored commented Jun 23, 2026

Copy link
Copy Markdown
Owner

THE STALL — Gittensory Gate self-deadlock (critical)

Diagnosed from the LIVE audit_events ledger (review_targets/review_audit are frozen at the 17:28Z cutover — that's the counter problem, separate). The Gittensory Gate is a required check, and fetchLiveCiAggregate counted it like any CI. A review posts the gate in_progress, then prReadyForReview waits for ALL required CI — but the gate only finishes when the review it's deferring runs. So every green-CI PR deferred forever (review_deferred_ci_pending was 38/30min; metagraphed #1532 deferred 4× with all checks green).

Fix: fetchLiveCiAggregate now skips the bot's own GITTENSORY_GATE_CHECK_NAME in the check-runs + status loops — it waits on real CI only, never its own gate. Test: green test + in_progress Gittensory Gate (gate in the required set) → passed, not pending.

Guardrail flood-hardening (also here)

  • Fail-CLOSED on a KV read fault (outage during a flood must never auto-merge crown jewels).
  • Broadened LIVE KV globs (already live): gittensory engine dirs (src/upstream/**,src/settings/**,src/review/**,src/services/**,src/github/**,src/config/**); metagraphed src/** (covers src/mcp-server.mjs).

Full suite green (3492).

Flood-readiness (emission weights rose on metagraphed + gittensory; a contributor
wave is imminent). Two guardrail hardenings:

1. Fail-CLOSED on a KV read fault. loadHardGuardrailGlobs previously fell back to the
   narrow default (.github/workflows + scripts) on a THROWN read, so a KV outage
   correlated with a flood would silently shrink the guarded surface and let
   crown-jewel edits (scoring/auth/rules/the gate) auto-merge. A thrown read now
   returns FAIL_CLOSED_GUARDRAIL_GLOBS = ['**'] → every PR is held for human review
   until the read recovers. A legitimately-absent key still uses the narrow default
   so a freshly-installed repo can operate.

2. Broadened the LIVE per-repo KV globs (done out-of-band, effective immediately):
   - gittensory: added src/upstream/**, src/settings/**, src/review/**,
     src/services/**, src/github/**, src/config/** — the gate/decision/reviewer/
     scoring/auth engine that lived OUTSIDE the old dir-prefix guards (e.g.
     score-breakdown.ts, command-authorization.ts, agent-actions.ts, ai-review.ts,
     ruleset.ts). This is the awesome-claude #4196 incident class.
   - metagraphed: added src/** (the old config guarded specific .mjs files but NOT
     src/mcp-server.mjs — the file PR #1528 touched).

Tests: change-guardrail asserts the crucial out-of-dir files now hit the guardrail
while infra/data/registry/docs/tests still auto-merge; guardrail-config asserts the
outage path fails closed. Full suite green (3489).
@dosubot dosubot Bot added the size:S label Jun 23, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.79%. Comparing base (d4fab41) to head (520a126).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/github/backfill.ts 33.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1099      +/-   ##
==========================================
- Coverage   94.79%   94.79%   -0.01%     
==========================================
  Files         153      153              
  Lines       18551    18554       +3     
  Branches     6706     6708       +2     
==========================================
+ Hits        17586    17588       +2     
  Misses        408      408              
- Partials      557      558       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ws under load

ROOT CAUSE of the stall (diagnosed from the LIVE audit_events ledger, not the frozen
review_targets/review_audit): the Gittensory Gate is a REQUIRED check, and
fetchLiveCiAggregate counted it like any other CI. A review posts the gate as
in_progress, then prReadyForReview waits for ALL required CI to finish — but the gate
never finishes (it's only concluded by the very review being deferred). So every
green-CI PR deferred forever as 'CI still running' (38 review_deferred_ci_pending in 30
min; metagraphed #1532 deferred 4x with all checks green).

Fix: fetchLiveCiAggregate now SKIPS the bot's own GITTENSORY_GATE_CHECK_NAME in both the
check-runs and commit-status loops, so the bot waits on real CI only and never on its
own gate. Test: a green 'test' check + an in_progress 'Gittensory Gate' (gate in the
required set) now reports ciState 'passed', not 'pending'.
@JSONbored JSONbored changed the title fix(guardrail): fail-closed on KV outage + broaden crucial-path coverage fix(review): break Gittensory Gate self-deadlock + guardrail flood-hardening Jun 23, 2026
@JSONbored
JSONbored merged commit 26e04bc into main Jun 23, 2026
12 checks passed
@JSONbored
JSONbored deleted the feat/guardrail-flood-hardening branch June 23, 2026 20:17
JSONbored added a commit that referenced this pull request Jun 23, 2026
…it — completes the self-deadlock fix (#1105)

#1099 excluded only Gittensory Gate, but the bot posts TWO checks as in_progress while reviewing —
Gittensory Gate AND Gittensory Context (app.ts:23-24). Counting Context re-created the exact same
self-deadlock: green-CI PRs (e.g. metagraphed #1532, all real checks success/neutral) deferred forever as
'CI still running' because the bot waited on its own in_progress Context check. Generalize the exclusion to
a BOT_OWNED_CHECK_NAMES set so the bot never waits on ANY check it posts itself. Test now asserts both
in_progress bot checks are ignored -> ciState 'passed'.
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