Skip to content

test(miner): lock in doctor four-state coding-agent CLI matrix (#5195)#5360

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:feat-miner-doctor-cli-state-tests-5195
Jul 12, 2026
Merged

test(miner): lock in doctor four-state coding-agent CLI matrix (#5195)#5360
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:feat-miner-doctor-cli-state-tests-5195

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Closes #5195

Summary

Adds a dedicated #5195 regression block to test/unit/miner-cli-doctor-checks.test.ts that locks in the four-state behavior introduced by #5165 (provider-gated CLI presence) and #5166 (codex auth remediation wording). Test-only PR — no changes to packages/gittensory-miner/lib/laptop-init.js.

The parent gating PR landed partial coverage under the #5165 describe block; this PR adds the explicit 4×2 matrix plus an invariant so reviewers can trust doctor distinguishes “not installed, nobody cares” from “configured but missing, every attempt will fail.”

Changes

Area Change
test/unit/miner-cli-doctor-checks.test.ts New four-state coding-agent CLI matrix (#5195) describe: 8 parameterized cases + invariant

Four-state matrix (shipped behavior)

State MINER_CODING_AGENT_PROVIDER CLI ok Detail tone
a unset missing true advisory — optional until a driver is configured
b unset present, unauthenticated true advisory auth hint
c matching provider missing false hard failure — every attempt will fail
d matching provider present, unauthenticated true actionable auth remediation (codex) or generic advisory (claude)

Note: Issue text originally described state (d) as ok: false; merged #5165/#5166 keep ok: true when the CLI binary is present but credentials are missing — only absence is a hard doctor failure. Tests assert the shipped strings and booleans.

All cases inject MINER_CODING_AGENT_PROVIDER via the existing options.env pattern (no global process.env mutation).

Test plan

  • 8 matrix cases assert both ok and exact detail strings (claude + codex × 4 states)
  • Invariant: ok: false only when the matching configured provider's CLI is absent; always ok: true for unconfigured/different-provider checks and for present-but-unauthenticated CLIs
  • No production code touched
  • npx vitest run test/unit/miner-cli-doctor-checks.test.ts
  • npm run test:ci

Dependencies

  • #5165MINER_CODING_AGENT_PROVIDER-aware gating (merged)
  • #5166 — codex auth-freshness remediation detail (merged)

Notes

  • Issue labels: help wanted, gittensor:feature — confirm contributor eligibility before opening.
  • packages/gittensory-miner/** is outside Codecov patch scope until #4864; this PR only touches test/**.

@andriypolanski
andriypolanski marked this pull request as draft July 12, 2026 14:55
@superagent-security

superagent-security Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor
\nSuperagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Tip

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

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 15:02:12 UTC

1 file · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a test-only PR that adds a parameterized 8-case matrix plus an invariant test to lock in the four-state doctor CLI-presence behavior (unconfigured/configured × missing/present-unauthenticated) that was already shipped in laptop-init.js by #5165/#5166. Tracing the assertions against the actual source in checkClaudeCliPresent/checkCodexCliPresent confirms every expected `ok`/`detail` pair matches the shipped logic exactly, including the correct handling of the codex auth-freshness remediation string and the cross-provider advisory cases. The PR correctly documents that the issue text originally called for `ok:false` in state (d) but tests the shipped `ok:true` behavior instead, which is honest and consistent with the real code rather than a fabricated expectation.

Nits — 5 non-blocking
  • The new describe block duplicates several assertions already covered in the 'Gate doctor's claude/codex CLI-presence checks by the configured MINER_CODING_AGENT_PROVIDER #5165' describe block above it (e.g. missing+configured, missing+different-provider) — consider whether the matrix is meant to fully replace that block in a future cleanup rather than living alongside it indefinitely.
  • test/unit/miner-cli-doctor-checks.test.ts: the `run` callback's `authPath` parameter is only used by 2 of the 8 matrix entries; the other 6 silently ignore it, which is fine but slightly obscures the matrix's uniform shape at a glance.
  • Consider a short comment above the matrix noting it supersedes/overlaps the older Gate doctor's claude/codex CLI-presence checks by the configured MINER_CODING_AGENT_PROVIDER #5165 describe block, so future readers know both exist intentionally rather than by oversight.
  • nit: test/unit/miner-cli-doctor-checks.test.ts:209 gives every MatrixCase.run an authPath argument even though the Claude cases and missing-CLI cases ignore it, which makes the table slightly noisier than the behavior under test.
  • nit: test/unit/miner-cli-doctor-checks.test.ts:297 repeats several cases already asserted by the parameterized matrix, so the invariant is useful as a contract summary but adds some maintenance duplication if the detail rules change later.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #5195
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 148 registered-repo PR(s), 100 merged, 29 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 148 PR(s), 29 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed). LLM value judgment: minor — The PR closes issue #5195 by adding solid regression coverage for already-shipped behavior, but it's incremental test hardening on top of overlapping existing tests rather than new capability or a bug fix.
Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 148 PR(s), 29 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (17f988e) to head (97c1ab3).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5360      +/-   ##
==========================================
- Coverage   94.40%   94.36%   -0.04%     
==========================================
  Files         550      550              
  Lines       44119    44119              
  Branches    14632    14632              
==========================================
- Hits        41652    41635      -17     
- Misses       1792     1809      +17     
  Partials      675      675              
Flag Coverage Δ
shard-1 43.75% <ø> (-0.26%) ⬇️
shard-2 34.13% <ø> (-0.52%) ⬇️
shard-3 32.16% <ø> (+0.55%) ⬆️
shard-4 31.21% <ø> (-0.06%) ⬇️
shard-5 33.04% <ø> (-0.27%) ⬇️
shard-6 43.63% <ø> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

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

@andriypolanski
andriypolanski marked this pull request as ready for review July 12, 2026 15:00

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit dc94169 into JSONbored:main Jul 12, 2026
15 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 12, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 12, 2026
@andriypolanski
andriypolanski deleted the feat-miner-doctor-cli-state-tests-5195 branch July 16, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests asserting doctor distinguishes unconfigured-vs-broken coding-agent CLI states

2 participants