Skip to content

feat(miner-hands): lint-guarded edit wrapper for coding-agent drivers (#4276) - #4477

Closed
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-lint-guard-4276
Closed

feat(miner-hands): lint-guarded edit wrapper for coding-agent drivers (#4276)#4477
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-lint-guard-4276

Conversation

@joaovictor91123

Copy link
Copy Markdown
Contributor

Summary

  • Adds packages/gittensory-engine/src/miner/lint-guard.ts, wrapping a CodingAgentDriver result with the existing per-package correctness check before it reaches the acceptance gate.
  • Classifies each changed file into the package whose existing check governs it: apps/gittensory-ui -> ui:typecheck, packages/gittensory-engine -> its own tsc -p tsconfig.json build, packages/gittensory-miner/packages/gittensory-mcp .js files -> node --check (per file), everything else (including non-.js files like hand-written .d.ts under those two packages) -> the root npm run typecheck.
  • Runs one check per package group (not one per file) since tsc/ui:typecheck validate a whole package at once — node --check is the one exception, since it's inherently per-file.
  • guardCodingAgentDriverResult decorates a CodingAgentDriverResult with the guard's verdict, skipping the guard entirely (empty, passing) when the driver itself failed or reported no changed files.
  • No new linter is introduced — this reuses the exact checks the repo already runs in CI.

Test plan

  • npx vitest run test/unit/coding-agent-miner.test.ts — 39/39 passing, including the new describe("lint-guarded edit wrapper (#4276)", ...) block covering package classification (all 5 outcomes, .d.ts fallthrough, Windows backslash-path normalization), guardChangedFiles (root typecheck failure, node --check syntax-error failure, clean pass, multi-package changeset checked once per package, same-package grouping), and guardCodingAgentDriverResult (skip-on-driver-failure, skip-on-no-changes, propagate-failure, preserve-fields-on-success).
  • npm --workspace @jsonbored/gittensory-engine run build — clean.
  • npm run typecheck — clean.
  • Isolated coverage of the new file via 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" — 100% statements/branches/functions/lines.
  • Did not run the full unsharded npm run test:coverage locally (shared/resource-contended machine); relying on CI's Codecov patch-coverage gate plus the isolated-coverage check above.

Fixes #4276.

…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.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.03%. Comparing base (453c5d4) to head (52e7785).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4477   +/-   ##
=======================================
  Coverage   94.03%   94.03%           
=======================================
  Files         420      421    +1     
  Lines       37521    37553   +32     
  Branches    13701    13710    +9     
=======================================
+ Hits        35282    35314   +32     
  Misses       1583     1583           
  Partials      656      656           
Files with missing lines Coverage Δ
packages/gittensory-engine/src/miner/lint-guard.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-09 21:33:09 UTC

3 files · 1 AI reviewer · 1 blocker · readiness 100/100 · CI green · clean

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: The PR description claims the guard sits 'before [the result] reaches the acceptance gate,' but no code in this diff (or referenced elsewhere) calls `guardCodingAgentDriverResult`/`guardChangedFiles` from `coding-agent-invoke.ts`, `driver-factory.ts`, or any gate/acceptance path — the new module is exported from the barrel (packages/gittensory-engine/src/index.ts:192-201) but has zero real callers, so as written it guards nothing
  • either point to the wiring commit/PR or add the call site here. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
Adds a new `lint-guard.ts` module in packages/gittensory-engine that classifies changed files by package and runs the existing per-package check (root typecheck, engine build, ui:typecheck, or per-file `node --check` for miner/mcp JS) via an injected spawn function, plus a `guardCodingAgentDriverResult` wrapper that skips the guard when the driver failed or made no changes. The classification logic, grouping-by-package, and skip conditions are correct and well covered by the 13 new tests (path normalization, multi-package grouping run-once-per-package, failure propagation, driver-failure/no-changes skip paths). The notable gap: nothing in this diff actually calls `guardCodingAgentDriverResult` from the coding-agent invocation path (`coding-agent-invoke.ts` / `driver-factory.ts`) or from any acceptance-gate code, despite the PR description stating the check runs 'before it reaches the acceptance gate' — as shipped, this is an inert, unreferenced utility.

Blockers

  • The PR description claims the guard sits 'before [the result] reaches the acceptance gate,' but no code in this diff (or referenced elsewhere) calls `guardCodingAgentDriverResult`/`guardChangedFiles` from `coding-agent-invoke.ts`, `driver-factory.ts`, or any gate/acceptance path — the new module is exported from the barrel (packages/gittensory-engine/src/index.ts:192-201) but has zero real callers, so as written it guards nothing; either point to the wiring commit/PR or add the call site here.
Nits — 5 non-blocking
  • packages/gittensory-engine/src/miner/lint-guard.ts:32 — `LintGuardSpawnResult` is exported but never used anywhere in the file (the real spawn results are typed inline via `LintGuardSpawnFn`'s return type) and isn't re-exported from index.ts either; drop it or actually use it.
  • packages/gittensory-engine/src/miner/lint-guard.ts:79-86 — `node --check` calls for miner-js/mcp-js files run sequentially in a `for` loop; fine at today's scale but consider `Promise.all` if changesets with many JS files become common.
  • No direct test calls `guardChangedFiles([])` — only the driver-result skip path exercises the empty-array case indirectly; worth one direct test since `checks.every(...)` on an empty array trivially returns `ok: true`.
  • packages/gittensory-engine/src/miner/lint-guard.ts:74 — for multi-file package checks (root/engine/ui), `file: files.join(", ")` packs multiple paths into one string field; consider a `files: string[]` field instead for cleaner downstream consumption.
  • Link or confirm the follow-up PR that wires `guardCodingAgentDriverResult` into the actual driver-invocation/acceptance path — until then this should probably be described as a standalone utility, not as already gating anything.

Why this is blocked

  • The PR description claims the guard sits 'before [the result] reaches the acceptance gate,' but no code in this diff (or referenced elsewhere) calls `guardCodingAgentDriverResult`/`guardChangedFiles` from `coding-agent-invoke.ts`, `driver-factory.ts`, or any gate/acceptance path — the new module is exported from the barrel (packages/gittensory-engine/src/index.ts:192-201) but has zero real callers, so as written it guards nothing; either point to the wiring commit/PR or add the call site here.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #4276
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: 95 registered-repo PR(s), 46 merged, 10 issue(s).
Contributor context ✅ Confirmed Gittensor contributor joaovictor91123; Gittensor profile; 95 PR(s), 10 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Linked issue satisfaction

Addressed
The PR adds lint-guard.ts implementing exactly the corrected scope from the issue: it classifies changed files by package and runs the existing per-package check (root tsc --noEmit, engine's own tsc build, node --check per gittensory-miner/mcp JS file, ui:typecheck for the UI app) rather than introducing a new linter, and returns a structured LintGuardResult/LintGuardedDriverResult instead of thro

Review context
  • Author: joaovictor91123
  • 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: 95 PR(s), 10 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.

🟩 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 the manual-review Gittensor contributor context label Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: The PR description claims the guard sits 'before [the result] reaches the acceptance gate,' but no code in this diff (or referenced elsewhere) calls `guardCodingAgentDriverResult`/`guardChangedFiles` from `coding-agent-invoke.ts`, `driver-factory.ts`, or any gate/acceptance path — the new module is exported from the barrel (packages/gittensory-engine/src/index.ts:192-201) but has zero real callers, so as written it guards nothing; either point to the wiring commit/PR or add the call site here.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

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. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-hands): lint-guarded edit wrapper for coding-agent drivers

1 participant