feat(miner-hands): lint-guarded edit wrapper for coding-agent drivers (#4276) - #4486
Conversation
…JSONbored#4276) Wraps a CodingAgentDriver result with the existing per-package check (root tsc, engine tsc, node --check for miner/mcp JS, ui:typecheck) so a bad coding-agent edit is caught before it reaches the acceptance-gate, without introducing a new linter into the repo.
…ed#4276) The prior commit added the lint-guard module but nothing called it. runCodingAgentAttempt now accepts an optional lintGuard option and, when supplied, runs the driver's changed files through it before returning, downgrading ok when a check fails. Omitting the option preserves the existing behavior exactly.
|
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 #4486 +/- ##
=======================================
Coverage 94.03% 94.03%
=======================================
Files 420 421 +1
Lines 37521 37554 +33
Branches 13701 13711 +10
=======================================
+ Hits 35282 35315 +33
Misses 1583 1583
Partials 656 656
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 22:12:24 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 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.
|
Summary
packages/gittensory-engine/src/miner/lint-guard.ts, which classifies each changed file into the package whose existing check governs it:apps/gittensory-ui->ui:typecheck,packages/gittensory-engine-> its owntsc -p tsconfig.jsonbuild,packages/gittensory-miner/packages/gittensory-mcp.jsfiles ->node --check(per file), everything else (including non-.jsfiles like hand-written.d.tsunder those two packages) -> the rootnpm run typecheck. Runs one check per package group, not per file (exceptnode --check, which is inherently per-file).runCodingAgentAttempt(packages/gittensory-engine/src/miner/driver-factory.ts) now accepts an optionallintGuard: LintGuardOptionsoption. When supplied, the driver's changed files are run throughguardCodingAgentDriverResultbefore the caller sees the result, downgradingok: falseif any check fails. Omitting the option preserves the previous behavior exactly — this is a real call site into the coding-agent invocation path, not a standalone/unreferenced utility.This is a resubmission of #4477, which the review gate correctly closed for shipping the guard module with zero real callers. This version wires
guardCodingAgentDriverResultintorunCodingAgentAttempt's live path and addresses the nits (removed the unusedLintGuardSpawnResulttype, added a directguardChangedFiles([])test).Test plan
npx vitest run test/unit/coding-agent-miner.test.ts— 43/43 passing, including package classification (all 5 outcomes,.d.tsfallthrough, Windows backslash-path normalization),guardChangedFiles(root/engine/miner-js/ui failures, clean pass, multi-package changeset checked once per package, same-package grouping, empty changeset),guardCodingAgentDriverResult(skip-on-driver-failure, skip-on-no-changes, propagate-failure, preserve-fields-on-success), andrunCodingAgentAttemptwiring (omittedlintGuardis a no-op, suppliedlintGuardfails/passes the attempt).npm --workspace @jsonbored/gittensory-engine run build— clean.npm run typecheck— clean.COVERAGE_NO_THRESHOLDS=1 npx vitest run test/unit/coding-agent-miner.test.ts --coverage --coverage.include="packages/gittensory-engine/src/miner/lint-guard.ts" --coverage.include="packages/gittensory-engine/src/miner/driver-factory.ts"— 100% statements/branches/functions/lines on both touched files.npm run test:coveragelocally (shared/resource-contended machine); relying on CI's Codecov patch-coverage gate plus the isolated-coverage check above.Fixes #4276.