Skip to content

fix(review): cache the AI slop advisory result per head SHA - #4025

Merged
JSONbored merged 2 commits into
mainfrom
fix/slop-advisory-result-cache
Jul 7, 2026
Merged

fix(review): cache the AI slop advisory result per head SHA#4025
JSONbored merged 2 commits into
mainfrom
fix/slop-advisory-result-cache

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

runGittensoryAiSlopAdvisory made a real LLM call (up to 6 free-tier attempts, or a BYOK call) on every gate pass with zero caching, so the scheduled re-gate sweep re-spent it on every tick even at an unchanged head. Confirmed with a direct production query: 1,469 ai_slop_pr calls in the last 24 hours across our 3 registered repos, with 110 calls on a single PR alone.

This adds ai_slop_cache, keyed on (repo_full_name, pull_number, head_sha), following the shape of the existing ai_review_cache (see getCachedAiReview/putCachedAiReview in src/db/repositories.ts) but deliberately simpler: the slop advisory has no dynamic-context dimension the way AI review does (no RAG/grounding/enrichment feeds into it — its only inputs are the PR title/body/diff/deterministic band, all of which are already pinned to the head SHA) and nothing analogous to a "published" GitHub artifact to protect against replaying (its output folds into the same advisory pass that computes it, never stamped separately). So a cache hit here is unconditionally durable for a given head — no cacheable/published_at cooldown columns, unlike ai_review_cache.

The cache is fingerprinted on the one input that CAN change independently of the head SHA: which provider would answer (free/default reviewer vs. a repo's BYOK key/model), so toggling BYOK or changing its provider/model correctly misses a stale cache row instead of replaying an opinion from a different reviewer.

Observability mirrors the ai_review_cache house style: gittensory_ai_slop_cache_hit_total / _miss_total / _write_error_total metrics, and github_app.ai_slop_cache_hit / _miss / _write_error audit events.

No issue because: this is a small, self-evident production bug fix backed by direct production data (linkedIssuePolicy on this repo is preferred, not required, and this fix is narrowly scoped to one call site).

Operational follow-up (not part of this PR): gate.slop.aiAdvisory was disabled as an emergency stopgap on the self-hosted VPS config for all 3 repos while this bug was live. Once this PR is merged and deployed, it should be re-enabled — that's a VPS config change outside this PR's scope.

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 — no open issue; see the no-issue rationale above.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; 100% line AND branch coverage confirmed on every changed line across all 5 touched/added src/** files (verified via a full ~10,600-test clean run's coverage/lcov.info, cross-checked against the exact changed-line ranges).
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries: 61 tests across test/unit/ai-slop-cache.test.ts (new, dedicated repository-function + fingerprint tests) and test/unit/ai-slop.test.ts (cache-hit/miss/write-back wiring, fail-safe on read/write throws including a doubly-nested failure, BYOK-toggle cache invalidation, and the pre-existing 42 tests all still pass unmodified), plus a test/unit/schema-timestamp-defaults.test.ts case for the new table's Drizzle $defaultFn.

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 (unchanged — this PR only changes when the existing advisory is computed vs. reused, not its content).
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. N/A — no auth/session/CORS surface touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed. N/A — no API routes changed; ui:openapi:check confirms no drift.
  • UI changes use live API data or real empty/error/loading states. N/A — backend-only change.
  • Visible UI changes include a UI Evidence section. N/A — no visible/UI change.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. No changelog edit (not a release-prep PR).

Notes

  • Migration 0119_ai_slop_cache.sql re-verified as the correct next-free number immediately before every push, given very active concurrent development on this repo (main moved several times over the course of this change).

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

❌ 51 Tests Failed:

Tests completed Failed Passed Skipped
10564 51 10513 7
View the top 3 failed test(s) by shortest run time
test/unit/mcp-server-telemetry.test.ts > MCP server telemetry > falls back when Hono does not expose an execution context
Stack Traces | 0.012s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-server-telemetry.test.ts > MCP server telemetry > records session-scoped MCP request errors without a tool name
Stack Traces | 0.0238s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-server-telemetry.test.ts > MCP server telemetry > records sanitized error telemetry when the MCP transport handler throws
Stack Traces | 0.25s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
View the full list of 48 ❄️ flaky test(s)
test/integration/api.test.ts > test/integration/api.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/maintainer-activation.test.ts > test/integration/maintainer-activation.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/orb-broker.test.ts > test/integration/orb-broker.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/orb-ingest.test.ts > test/integration/orb-ingest.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/orb-oauth.test.ts > test/integration/orb-oauth.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/orb-onboarding.test.ts > test/integration/orb-onboarding.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/orb-relay.test.ts > test/integration/orb-relay.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/orb-webhook.test.ts > test/integration/orb-webhook.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/public-quality-metrics-route-error.test.ts > test/integration/public-quality-metrics-route-error.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/public-stats-route-error.test.ts > test/integration/public-stats-route-error.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/public-stats-route.test.ts > test/integration/public-stats-route.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/routes-errors.test.ts > test/integration/routes-errors.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/integration/subnet-interface.test.ts > test/integration/subnet-interface.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/access-boundary.test.ts > test/unit/access-boundary.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/ai-key-byok.test.ts > test/unit/ai-key-byok.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/docs-examples-schema.test.ts > test/unit/docs-examples-schema.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/draft.test.ts > test/unit/draft.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/index.test.ts > test/unit/index.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/issue-watch.test.ts > test/unit/issue-watch.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/linear-key.test.ts > test/unit/linear-key.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-automation-state.test.ts > test/unit/mcp-automation-state.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-check-slop-risk.test.ts > test/unit/mcp-check-slop-risk.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-fleet-analytics.test.ts > test/unit/mcp-fleet-analytics.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-miner-prompts.test.ts > test/unit/mcp-miner-prompts.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-notifications.test.ts > test/unit/mcp-notifications.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-output-schemas.test.ts > test/unit/mcp-output-schemas.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-plan-dag.test.ts > test/unit/mcp-plan-dag.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-planning-elicitation.test.ts > test/unit/mcp-planning-elicitation.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-predict-gate.test.ts > test/unit/mcp-predict-gate.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-refresh-repo-docs.test.ts > test/unit/mcp-refresh-repo-docs.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-run-local-scorer.test.ts > test/unit/mcp-run-local-scorer.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-suggest-boundary-tests.test.ts > test/unit/mcp-suggest-boundary-tests.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-upstream.test.ts > test/unit/mcp-upstream.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/mcp-write-tools.test.ts > test/unit/mcp-write-tools.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/ops-wire.test.ts > test/unit/ops-wire.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/parity-wire.test.ts > test/unit/parity-wire.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/plan-templates.test.ts > test/unit/plan-templates.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/retention.test.ts > test/unit/retention.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-agent-approval.test.ts > test/unit/routes-agent-approval.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-ai-byok.test.ts > test/unit/routes-ai-byok.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-check-before-start.test.ts > test/unit/routes-check-before-start.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-contributor-issue-draft.test.ts > test/unit/routes-contributor-issue-draft.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-extension.test.ts > test/unit/routes-extension.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-focus-manifest.test.ts > test/unit/routes-focus-manifest.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-kill-switch.test.ts > test/unit/routes-kill-switch.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-remediation-plan.test.ts > test/unit/routes-remediation-plan.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-self-dogfood-registration-pack.test.ts > test/unit/routes-self-dogfood-registration-pack.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1
test/unit/routes-selfhost-dead-letter-queue.test.ts > test/unit/routes-selfhost-dead-letter-queue.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 0s run time
Error: Failed to resolve entry for package "@jsonbored/gittensory-engine". The package may have incorrect main/module/exports specified in its package.json.
 ❯ .../gittensory-miner/lib/opportunity-fanout.js:2:1
 ❯ src/mcp/find-opportunities.ts:11:1

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 Gittensory review result - fixes required

Review updated: 2026-07-07 11:22:11 UTC

9 files · 3 blockers · readiness 100/100 · CI failing · blocked

🛑 Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
  • Possible leaked secret in the diff (generic_secret_assignment) — Remove the secret from the diff, rotate the exposed credential, then re-run the gate.

Why this is blocked

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
  • Possible leaked secret in the diff (generic_secret_assignment) — Remove the secret from the diff, rotate the exposed credential, then re-run the gate.

CI checks failing

  • validate
  • validate-code
  • build + boot smoke test
Signal Result Evidence
Code review ❌ 3 blockers No AI review summary
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
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 (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 51 registered-repo PR(s), 43 merged, 570 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 51 PR(s), 570 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
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, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 51 PR(s), 570 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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 7, 2026
runGittensoryAiSlopAdvisory made a real LLM call (up to 6 free-tier
attempts, or a BYOK call) on every gate pass with no caching, so the
scheduled re-gate sweep re-spent it on every tick even at an unchanged
head. Confirmed in production: 1,469 ai_slop_pr calls in 24h across 3
repos, 110 of them on a single PR at the same head SHA.

Adds ai_slop_cache keyed on (repo_full_name, pull_number, head_sha),
mirroring ai_review_cache's shape but deliberately simpler: the slop
advisory has no dynamic-context dimension (no RAG/grounding/enrichment
feeds into it) and nothing analogous to a published GitHub artifact to
protect against replaying, so a hit is unconditionally durable — no
cacheable/cooldown columns needed. The cache is fingerprinted on which
provider would answer (free-tier vs. a repo's BYOK key/model) so a
config change still misses the cache, mirroring the observability shape
of the existing AI-review cache (cache-hit/miss/write-error metrics and
audit events).
@JSONbored
JSONbored force-pushed the fix/slop-advisory-result-cache branch from caf2d2a to 9067be8 Compare July 7, 2026 11:04
@JSONbored
JSONbored merged commit cf60d02 into main Jul 7, 2026
6 of 9 checks passed
@JSONbored
JSONbored deleted the fix/slop-advisory-result-cache branch July 7, 2026 11:22
JSONbored added a commit that referenced this pull request Jul 7, 2026
0119 was claimed by #4025 (ai_slop_cache), which merged first --
renumbered this migration to the next free number.
JSONbored added a commit that referenced this pull request Jul 7, 2026
… window (#4032)

* fix(review): persist linked-issue hard-rule violations past the grace window

resolveLinkedIssueHardRule is fully re-evaluated from scratch every
pass -- it re-parses linked issues from the PR's CURRENT body and reads
each linked issue's CURRENT live state, with no memory of a prior
pass's finding. During the flag-then-close verification window
(settings.linkedIssueHardRules.closeDelaySeconds), that statelessness
lets a confirmed violation dodge the close two ways: editing the PR
body to strip the closing reference so the next pass sees zero linked
issues, or the linked issue's live state changing (e.g. unassigned)
between the violating pass and the verification pass.

Add linkedIssueHardRuleViolatedAt/linkedIssueHardRuleViolationReason
columns (mirroring draftConversionCount's never-resets discipline and
mergeBlockedReason's pairing with mergeBlockedSha) so a PR that ever
confirms a violation stays flagged for its lifetime, merged with the
live re-parse result rather than replacing it.

* fix(db): renumber linked-issue hard-rule migration to 0120

0119 was claimed by #4025 (ai_slop_cache), which merged first --
renumbered this migration to the next free number.
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

Development

Successfully merging this pull request may close these issues.

1 participant