Skip to content

fix(miner): wire DEPLOYMENT.md audit into real CI execution - #6524

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-deployment-docs-audit-ci-6158
Jul 16, 2026
Merged

fix(miner): wire DEPLOYMENT.md audit into real CI execution#6524
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-deployment-docs-audit-ci-6158

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Add scripts/check-miner-deployment-docs.mjs that runs assertDeploymentDocsInSync against the live miner/engine trees and exits non-zero on drift.
  • Wire npm run test:miner-deployment-docs-audit into validate-code (miner lane) and test:ci.
  • Keep the checker outside packages/loopover-miner/ so it cannot trip test:miner-pack (supersedes approach in closed fix(miner): wire deployment-docs audit into real CI execution #6465).
  • Unit tests cover live pass + forced missing-env drift failure + CLI exit codes; .d.mts keeps validate-code happy.

Closes #6158

Test plan

  • npx vitest run test/unit/check-miner-deployment-docs.test.ts test/unit/miner-deployment-docs-audit.test.ts (22 pass)
  • npm run test:miner-deployment-docs-audit
  • CI green

Made with Cursor

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 16, 2026 11:39
@superagent-security

Copy link
Copy Markdown
Contributor

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

Add scripts/check-miner-deployment-docs.mjs (repo-root, not inside the published miner package) and invoke it from validate-code plus test:ci so doc drift fails CI as the audit module already claimed.

Closes JSONbored#6158

Co-authored-by: Cursor <cursoragent@cursor.com>
validate-code rejected Partial ProcessEnv literals in the unit test; accept Record<string, string | undefined> instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.56%. Comparing base (2caac30) to head (8d3a25b).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6524   +/-   ##
=======================================
  Coverage   95.56%   95.56%           
=======================================
  Files         589      589           
  Lines       47121    47121           
  Branches    14989    14989           
=======================================
  Hits        45032    45032           
  Misses       1297     1297           
  Partials      792      792           
Flag Coverage Δ
shard-1 44.07% <ø> (ø)
shard-2 36.83% <ø> (+0.12%) ⬆️
shard-3 32.36% <ø> (+0.01%) ⬆️
shard-4 34.60% <ø> (-0.65%) ⬇️
shard-5 30.98% <ø> (ø)
shard-6 45.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/loopover-miner/lib/deployment-docs-audit.js 100.00% <ø> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 16, 2026
@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-16 12:07:51 UTC

6 files · 1 AI reviewer · no blockers · CI green · unknown

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): .github/workflows/ci.yml (matched .github/workflows/**).

Review summary
This PR adds a small CI entrypoint script that wires the existing `assertDeploymentDocsInSync` checker (in `packages/loopover-miner/lib/deployment-docs-audit.js`) against live miner/engine source trees, plumbing it into both the CI workflow and `test:ci`/`validate-code`. The script builds real predicates (env-var reads, file existence, registered commands) from the actual source tree rather than fabricated data, and the forced-failure test simulates drift by overriding only `hasEnvRead` while keeping real claims/reality otherwise — a reasonable way to exercise the non-zero-exit path without editing fixtures. Wiring in `package.json` and `ci.yml` mirrors the existing `test:miner-pack` step (same `if` gate, same ordering), and keeping the script outside `packages/loopover-miner/` avoids re-triggering the miner-pack check as intended.

Nits — 6 non-blocking
  • scripts/check-miner-deployment-docs.mjs exports `buildLiveMinerDeploymentReality` 'for unit tests' but the visible test file only calls it indirectly via `runMinerDeploymentDocsAudit`/`main` — confirm it's actually exercised somewhere or drop the export comment.
  • The forced 'missing-env' test overrides `hasEnvRead` to always return false for every claim rather than a single targeted variable, so it can't distinguish a genuine per-variable drift message from a blanket failure — consider asserting on the specific failing variable name in the thrown message.
  • `readFilesWithExtension` (scripts/check-miner-deployment-docs.mjs) will throw an unhandled `ENOENT` if `LIB_DIR`/`BIN_DIR`/`ENGINE_MINER_DIR` don't exist; harmless today but worth a comment noting the assumption that these directories always exist in the live tree.
  • Consider having the live-pass test in test/unit/check-miner-deployment-docs.test.ts also assert on the specific set of env vars found (not just `toBeGreaterThan(0)`) to catch accidental claim-extraction regressions.
  • Double check `packages/loopover-miner/lib/deployment-docs-audit.js` already exports `extractEnvVarClaims`, `extractFilePathClaims`, `extractSubcommandClaims`, `scanEnvVarTokens`, and `scanRegisteredCommands` as imported by the new script, since the diff only shows a 2-line comment addition to that file.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ⚠️ Gate result — Not blocking (Advisory; not blocking this PR.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6465, #6158
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 (2 linked issues).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 333 registered-repo PR(s), 161 merged, 30 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 333 PR(s), 30 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, Ruby, Svelte, TypeScript, Markdown, MDX
  • Official Gittensor activity: 333 PR(s), 30 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.
🧪 Chat with LoopOver

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

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

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 16, 2026
@JSONbored
JSONbored merged commit 1019fb2 into JSONbored:main Jul 16, 2026
16 checks passed
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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(miner): deployment-docs-audit.js claims to fail CI on doc drift but is wired into no CI/build step

2 participants