Skip to content

feat(miner-governor): build a real production runSlopAssessment implementation (#5133) - #5140

Merged
JSONbored merged 2 commits into
mainfrom
feat/miner-slop-assessment-5133
Jul 12, 2026
Merged

feat(miner-governor): build a real production runSlopAssessment implementation (#5133)#5140
JSONbored merged 2 commits into
mainfrom
feat/miner-slop-assessment-5133

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Closes Build a real production runSlopAssessment implementation #5133 (Wave 3.5 epic Epic: Miner Wave 3.5 — Wire the autonomous loop end-to-end #5130, sub-issue C). attempt-runner.js's deps.runSlopAssessment had no production binding — only the test double in test/unit/miner-attempt-runner.test.ts existed. The real self-review scorer (src/signals/slop.ts) had never been made portable to the miner CLI.
  • Extracts the PR-side deterministic slop scorer to packages/gittensory-engine/src/signals/slop.ts — the canonical implementation now; src/signals/slop.ts becomes a partial re-export shim for the PR-side pieces (issue-side triage, not needed by the miner, stays local, unmoved).
  • Byte-parity verified, not assumed: every extracted function was diffed programmatically against the original (normalizing only the SignalFindingAdvisoryFinding type rename), and all 63 pre-existing test/unit/slop.test.ts tests pass unchanged against the new shim.
  • Caught and fixed one real discrepancy during that diff: my first transcription of the private nonNegative helper was missing the original's Number.isFinite guard and Math.trunc call — fixed to match exactly before this PR, so no scoring-behavior drift shipped.
  • Wires the now-portable buildSlopAssessment into packages/gittensory-miner/lib/slop-assessment.js's runSlopAssessment — a direct pass-through, since self-review-adapter.ts's SelfReviewSlopInput/SelfReviewSlopAssessment were already deliberately hand-kept structural mirrors of SlopAssessmentInput/SlopAssessment for exactly this purpose (see that file's own header comment).

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (Closes Build a real production runSlopAssessment implementation #5133).

Validation

  • git diff --check
  • npm run actionlint — not run (no workflow files touched)
  • npm run typecheck
  • npm run test:coverage (targeted: test/unit/slop.test.ts 65/65, test/unit/miner-slop-assessment.test.ts 3/3, plus the 4 other slop-dependent suites — 178/178 total passing; 100% statement/branch/function/line coverage on both the new packages/gittensory-engine/src/signals/slop.ts and the src/signals/slop.ts shim)
  • npm run test:workers — not run (no Workers runtime code touched)
  • npm run build:mcp / npm run test:mcp-pack — not run (no MCP server changes)
  • npm run ui:openapi:check / npm run ui:lint / npm run ui:typecheck / npm run ui:build — not run (no UI changes)
  • npm audit --audit-level=moderate — no new dependencies added
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — added direct tests for hasClearNoIssueRationale's omitted-body branch and buildUnfilledIssueTemplateFinding's omitted-body branch (both real, reachable via the public API but previously untested in isolation); the one genuinely unreachable branch (ensurePublicSafeText's fallback — every current caller only interpolates integer counts) is v8 ignore-marked with a comment, matching the existing isConfiguredCodingAgentDriver precedent in driver-factory.ts rather than fabricating an artificial test.

If any required check was skipped, explain why:

  • This PR's non-src/signals/slop.ts surface is scoped entirely to packages/gittensory-engine/packages/gittensory-miner (their own node --check/tsc -p build conventions, not the UI/Workers/MCP-pack pipelines) plus src/signals/slop.ts + its existing root test/unit/ coverage — the skipped checks above have no surface this diff touches.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no such changes.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A, no API/OpenAPI/MCP changes.
  • UI changes use live API data or real empty/error/loading states. — N/A, no UI changes.
  • UI Evidence — N/A, no visible UI change.
  • Public docs/changelogs are updated where needed. — N/A, no user-facing docs affected; changelog is release-prep only.

Notes

…mentation (#5133)

attempt-runner.js's deps.runSlopAssessment had no production binding, only
a test double. Extracts the PR-side deterministic slop scorer from
src/signals/slop.ts to packages/gittensory-engine/src/signals/slop.ts
(byte-parity verified: all 63 pre-existing tests pass unchanged, and every
extracted function diffed identical against the original), so the miner
CLI can run the SAME scorer the live gate uses. src/signals/slop.ts
becomes a partial shim re-exporting the PR-side pieces; issue-side triage
stays local (not needed by the miner). Wires the now-portable
buildSlopAssessment into a real runSlopAssessment binding in
packages/gittensory-miner, matching self-review-adapter.ts's own
structural-mirror design.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 0928068 Commit Preview URL

Branch Preview URL
Jul 12 2026, 04:32 AM

@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.33%. Comparing base (9396dc8) to head (465ad4c).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5140   +/-   ##
=======================================
  Coverage   94.32%   94.33%           
=======================================
  Files         471      472    +1     
  Lines       39837    39839    +2     
  Branches    14535    14535           
=======================================
+ Hits        37576    37581    +5     
  Misses       1583     1583           
+ Partials      678      675    -3     
Flag Coverage Δ
shard-1 46.46% <34.17%> (+0.12%) ⬆️
shard-2 34.58% <43.67%> (+0.13%) ⬆️
shard-3 30.97% <12.02%> (-0.29%) ⬇️
shard-4 32.88% <100.00%> (+0.14%) ⬆️
shard-5 33.67% <41.13%> (-0.08%) ⬇️
shard-6 44.88% <46.83%> (-0.06%) ⬇️

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

Files with missing lines Coverage Δ
packages/gittensory-engine/src/signals/slop.ts 100.00% <100.00%> (ø)
src/api/routes.ts 94.29% <ø> (ø)
src/mcp/server.ts 95.62% <ø> (ø)
src/queue/processors.ts 95.46% <ø> (ø)
src/signals/issue-slop.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 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

Caution

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

🛑 Gittensory review result - fixes required

Review updated: 2026-07-12 04:40:22 UTC

8 files · 2 AI reviewers · no blockers · readiness 100/100 · CI failing · blocked

🛑 Suggested Action - Manual Review

Review summary
This PR extracts the PR-side deterministic slop scorer from src/signals/slop.ts into packages/gittensory-engine/src/signals/slop.ts as the new canonical implementation, turns the original into a thin re-export shim that keeps the issue-side triage local, and wires the now-portable buildSlopAssessment into packages/gittensory-miner/lib/slop-assessment.js's previously-stubless runSlopAssessment binding. The extraction correctly threads AdvisoryFinding in place of SignalFinding, preserves the nonNegative/Number.isFinite guard, and the miner test directly asserts the binding matches buildSlopAssessment output rather than faking a stub. The one notable design tradeoff is that GENERIC_COMMIT_PATTERN/hasClearNoIssueRationale are now duplicated as a hand-kept mirror between packages/gittensory-engine/src/signals/slop.ts and src/signals/engine.ts, relying on manual sync rather than a single source of truth.

Nits — 6 non-blocking
  • packages/gittensory-engine/src/signals/slop.ts:22-27 hand-keeps a second copy of GENERIC_COMMIT_PATTERN/hasClearNoIssueRationale alongside the original in src/signals/engine.ts, with nothing but a comment enforcing the two stay identical over time — a future edit to one could silently diverge from the gate's own copy.
  • The new engine-side file (391 added lines) picks up only 3 new direct test cases (miner-slop-assessment.test.ts + the hasClearNoIssueRationale case in slop.test.ts); most of its behavior is exercised only indirectly through the pre-existing 63 slop.test.ts cases running against the src/signals/slop.ts shim, which likely explains the 47.82% patch-coverage number — worth adding tests that import the engine file directly so coverage attribution is accurate.
  • src/signals/slop.ts:29 imports the engine package via a relative source path (../../packages/gittensory-engine/src/signals/slop) rather than the published package the miner package consumes — confirm this really matches an existing established convention (cited as src/signals/test-evidence.ts) rather than being a one-off exception.
  • Add a small direct test file for packages/gittensory-engine/src/signals/slop.ts to close the patch-coverage gap flagged by codecov instead of relying entirely on the shim's inherited coverage.
  • Consider hoisting GENERIC_COMMIT_PATTERN/hasClearNoIssueRationale into a single shared module both engine.ts and the new engine-package file import, eliminating the hand-kept-mirror drift risk noted in the header comment.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.

CI checks failing

  • validate
  • codecov/patch — 47.82% of diff hit (target 99.00%)
  • validate-tests (5)
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #5133
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: 45 registered-repo PR(s), 37 merged, 414 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 45 PR(s), 414 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: moderate — The diff turns an injected miner self-review dependency from a test-only concept into a shared deterministic production implementation while preserving the existing backend slop API through a shim.
Linked issue satisfaction

Addressed
The PR extracts the deterministic slop scorer to packages/gittensory-engine (byte-parity verified against src/signals/slop.ts, with src/signals/slop.ts becoming a re-export shim) and adds a real, non-stub runSlopAssessment in packages/gittensory-miner/lib/slop-assessment.js that directly calls buildSlopAssessment, plus tests confirming its output matches the engine's scorer exactly. This fulfills

Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 45 PR(s), 414 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; 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

src/signals/slop.ts's PR-side exports were converted to a re-export
shim over packages/gittensory-engine/src/signals/slop.ts (#5133), but
the file still carried host-only issue-side triage code alongside the
shim, so scripts/check-engine-parity.ts's shim detection (which only
recognizes a file containing NOTHING but the re-export statement)
treated it as a hand-duplicated twin and failed on the now-intentional
divergence. Moves the issue-side code to src/signals/issue-slop.ts so
slop.ts is a pure shim again.
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. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

Build a real production runSlopAssessment implementation

1 participant