Skip to content

fix(gate): downgrade readiness gate mode block to advisory - #2384

Merged
JSONbored merged 2 commits into
mainfrom
claude/readiness-mode-block-deprecation
Jul 1, 2026
Merged

fix(gate): downgrade readiness gate mode block to advisory#2384
JSONbored merged 2 commits into
mainfrom
claude/readiness-mode-block-deprecation

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

gate.readiness.mode in .gittensory.yml (and the equivalent dashboard/API qualityGateMode field) is documented and parsed as the shared off | advisory | block tri-state used by every other gate dimension. In practice it can never block anything.

Fix

buildQualityGateWarning (src/rules/advisory.ts) always produces a warning-severity finding, and isConfiguredGateBlocker has no branch for the readiness/quality dimension at all — this is a deliberate, pre-existing design (readiness is intentionally informational-only). But the config parser silently accepted mode: block anyway, so a maintainer who set it believed a real quality floor was enforced, when the effective behavior was silently advisory-only.

Added normalizeReadinessGateMode in src/signals/focus-manifest.ts, wired into parseGateConfig for the gate.readiness.mode field only. It downgrades blockadvisory at parse time and pushes a clear deprecation warning pointing at gate.mergeReadiness or gate.manifestPolicy for an enforceable quality floor. The shared normalizeOptionalGateMode helper itself is untouched, since it's reused by other gate fields (linkedIssue, duplicates, aiReview, etc.) that legitimately support block.

Updated .gittensory.yml.example's readiness.mode doc comment to state only off | advisory are accepted, with a note on the downgrade-with-warning behavior.

Deliberately out of scope: src/api/routes.ts (repositorySettingsSchema/maintainerSettingsSchema) and src/openapi/schemas.ts (RepositorySettingsSchema/RepoSettingsPreviewSchema) still accept "block" for qualityGateMode in their Zod enums. These are read/response schemas as well as write-validation — narrowing them risks breaking API responses for any repo that already has quality_gate_mode = 'block' stored in the DB (deserialization would fail). Since the runtime already treats "block" as fully inert regardless of what's stored, leaving those schemas as-is is a safe, intentional deferral rather than an oversight.

Tests

  • New test: parseFocusManifest downgrades gate.readiness.mode: blockadvisory with a deprecation warning matching /gate\.readiness\.mode.*no longer accepts "block"/; an invalid mode still produces the normal "must be one of" warning and not the block-specific one.
  • Updated two existing focus-manifest.test.ts tests that previously used mode: "block" as incidental input for unrelated assertions — switched to "advisory" to preserve their original intent.
  • Updated gate-check-policy.test.ts's "overlays the friendly gate alias over DB settings" test: kept readiness: { mode: "block", minScore: 70 } as input (now a deliberate higher-level check) and asserted eff.qualityGateMode resolves to "advisory", confirming the downgrade propagates through resolveEffectiveSettings.
  • npx tsc --noEmit clean.
  • Scoped: focus-manifest.test.ts + gate-check-policy.test.ts — 222 passed.
  • Regression sweep: all 14 files importing src/signals/focus-manifest.ts — 278 passed.
  • Diff-range coverage-gap check on src/signals/focus-manifest.ts: fully covered.
  • Full unsharded npm run test:coverage: 5601 passed, 4 skipped (pre-existing/unrelated), 0 failed.
  • npm audit --audit-level=moderate: 0 vulnerabilities.

Advances #1936. Closes #2267.

@dosubot dosubot Bot added the size:S label Jul 1, 2026
@loopover-orb

loopover-orb Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-01 19:17:40 UTC

4 files · 1 AI reviewer · no blockers · readiness 75/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The change correctly downgrades the typed `gate.readiness.mode` alias from `block` to `advisory` and preserves the invalid-value warning path. The tests cover the alias-level downgrade and its overlay through `resolveEffectiveSettings`. The notable remaining problem is that the equivalent `qualityGateMode` setting path is still left able to carry the same inert hard-block value, so the fix only closes one configuration entry point.

Blockers

  • src/signals/focus-manifest.ts:436 only normalizes `gate.readiness.mode`, so `qualityGateMode: "block"` supplied through the generic settings/dashboard/API path still survives as an inert hard-block setting and preserves the false-enforcement state this PR is meant to remove.
Nits — 4 non-blocking
  • src/signals/focus-manifest.ts:360 has a long cross-module behavior comment that would be easier to maintain if it were shortened to the local invariant and left the detailed behavior proof in tests or nearby gate documentation.
  • Add the same `block` to `advisory` normalization at the `qualityGateMode` settings normalization or effective-settings boundary, while keeping response schemas backward-compatible with existing stored values.
  • Add a regression test for `settings.qualityGateMode: "block"` or an existing stored `qualityGateMode: "block"` resolving to `advisory`, matching the new `gate.readiness.mode` behavior.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2267
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:S; 1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 67 registered-repo PR(s), 57 merged, 589 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 67 PR(s), 589 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Triage stale or unlinked PRs.
  • No action.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.84%. Comparing base (6cef302) to head (2193bde).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2384   +/-   ##
=======================================
  Coverage   95.84%   95.84%           
=======================================
  Files         224      224           
  Lines       25042    25048    +6     
  Branches     9103     9106    +3     
=======================================
+ Hits        24001    24007    +6     
  Misses        427      427           
  Partials      614      614           
Files with missing lines Coverage Δ
src/api/routes.ts 94.66% <100.00%> (+<0.01%) ⬆️
src/signals/focus-manifest.ts 99.18% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

JSONbored added 2 commits July 1, 2026 14:40
gate.readiness.mode accepted the shared off/advisory/block tri-state,
but buildQualityGateWarning always produces a warning-severity finding
and isConfiguredGateBlocker has no branch for it — readiness/quality is
intentionally informational-only and can never hard-block a PR. A
maintainer setting mode: block believed a real quality floor was
enforced when the effective behavior was silently advisory-only.

Add normalizeReadinessGateMode to downgrade block to advisory at the
config-as-code parse layer, with a deprecation warning pointing at
mergeReadiness/manifestPolicy for an enforceable floor. The shared
normalizeOptionalGateMode is untouched since other gate fields
legitimately support block.
…board/API

normalizeReadinessGateMode downgrades gate.readiness.mode: block to advisory
at parse time, but that only covered the YAML gate: mapping. The identically
named qualityGateMode field reachable through .gittensory.yml's settings:
override, the maintainer dashboard save, and the internal settings write
endpoint all bypassed it, so a value supplied through any of those paths
still persisted and resolved as "block" — preserving the exact false belief
that a real quality floor is enforced.

Close it at every point the value can enter or be read:
- parseSettingsOverride now normalizes settings.qualityGateMode the same
  way as gate.readiness.mode (exported for reuse).
- Both settings-write API routes (maintainer PATCH-style save and the
  internal full-settings write) downgrade a written "block" before it
  reaches the DB.
- resolveEffectiveSettings downgrades "block" as a final step regardless
  of source, so a repo whose DB row already has quality_gate_mode = "block"
  from before these guards existed is also corrected wherever effective
  settings are read (the review/gate pipeline and the settings-preview
  dashboard both go through this same resolver).
@JSONbored
JSONbored force-pushed the claude/readiness-mode-block-deprecation branch from 1173ce8 to 2193bde Compare July 1, 2026 21:43
@dosubot dosubot Bot added size:M and removed size:S labels Jul 1, 2026
@JSONbored
JSONbored merged commit 4389690 into main Jul 1, 2026
11 checks passed
@JSONbored
JSONbored deleted the claude/readiness-mode-block-deprecation branch July 1, 2026 21:52
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 1, 2026
@github-actions github-actions Bot mentioned this pull request Jul 2, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

fix(review): gate.readiness.mode "block" is accepted and documented but the quality gate can never hard-block

1 participant