feat(miner-manage): add maintainer-gate verdict poller (read-only) - #4464
Conversation
New packages/gittensory-miner/lib/gate-verdict-poller.js: reads the REAL gate disposition from the gittensory API (the authoritative server-internal gate_decision, not a GitHub check-run) and maps it to a typed verdict (merge | close | hold | pending), replacing manage-poll.js's CI-conclusion-as-proxy heuristic as the source of the gateVerdict signal. - mapGateDisposition / readGateDisposition: pure, synonym-tolerant, unknown/missing -> pending. - pollGateVerdict: injectable fetchFn/sleepFn + exponential backoff while pending (fully unit-testable, no real network). Read-only, no GitHub token (targets the gittensory API); ci-poller.js left untouched. Closes JSONbored#4273
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4464 +/- ##
=======================================
Coverage 94.01% 94.01%
=======================================
Files 418 418
Lines 37410 37410
Branches 13675 13675
=======================================
Hits 35171 35171
Misses 1583 1583
Partials 656 656 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 20:20:37 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Flagged checks (non-blocking)
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
Adds a read-only poller for the miner's own PRs' REAL gate disposition (Closes #4273).
Today
manage-poll.js'smapPollConclusionToGateVerdictturnsci-poller.js's generic CI-check-run aggregate into a pass/block/advisory proxy — but the authoritative gate verdict is server-internalgate_decisionstate, not a GitHub check-run. This reads the real source:mapGateDisposition/readGateDisposition— pure: read the disposition from the API body (tolerant ofdisposition/gateDisposition/verdict) and map it to a typed verdictmerge | close | hold | pending. Synonym-tolerant, case-insensitive; unknown/missing →pending(never a false decided verdict).pollGateVerdict(url, options)— polls until a decided verdict ormaxAttempts, backing off exponentially while pending. InjectablefetchFn/sleepFn(mirrorsci-poller.js) → fully unit-testable with no real network. Throws on a missing URL or non-OK HTTP.Read-only, no GitHub token (targets the gittensory API, not
api.github.com; any endpoint auth is passed viaoptions.headers).ci-poller.jsis left untouched — CI state and gate verdict are two different signals a caller records independently.Test
test/unit/miner-gate-verdict-poller.test.ts(injectedfetchFn/sleepFn, no network) — the frozen vocab, each disposition family + synonyms + the pending fallback, tolerant field reading, a first-attempt decided verdict (no sleep), backoff-while-pending (asserts the exact backoff delays), exhausted-while-pending, and a non-OK HTTP throw. 9 tests pass;build:miner+test:miner-pack+ typecheck green.site//CNAME/**/lovable/**; noCHANGELOG.md. Three new files (module +.d.ts+ test), no shared-file edits, no secrets.