Skip to content

refactor: reduce fallback slop in zero run settings#20734

Merged
e7h4n merged 1 commit into
mainfrom
zero/ai-slop-fallback-cleanup-20260709
Jul 8, 2026
Merged

refactor: reduce fallback slop in zero run settings#20734
e7h4n merged 1 commit into
mainfrom
zero/ai-slop-fallback-cleanup-20260709

Conversation

@e7h4n

@e7h4n e7h4n commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Daily AI-slop fallback cleanup focused on nullable database boundaries in zero run settings. This keeps existing command-over-agent precedence and makes null-to-undefined normalization explicit where downstream CreateAgentRunArgs and Slack message footer resolvers expect optional strings.

Scan

  • Scan timestamp: 2026-07-08T20:01:54.675Z
  • Base commit: 18a10c5
  • Files scanned: 4052

Total matches by category:

  • nullish: 5589
  • nullish-chain: 126
  • field-fallback-chain: 102
  • optional-prop: 5832
  • zod-optional: 2174
  • zod-loose-optional: 3
  • loose-record: 1272
  • loose-index-signature: 5
  • as-any: 0
  • as-unknown-as: 30
  • empty-fallback: 650
  • string-fallback: 707
  • null-undefined-fallback: 1524
  • empty-catch: 3
  • promise-catch-swallow: 14
  • rust-unwrap-or: 602
  • rust-ok-discard: 144

Budget

  • actionable_total: 223 high-confidence production-actionable scanner records
  • initial edit_budget: 12 scanner records
  • adjusted edit_budget: 6 scanner records after reading surrounding code and excluding sampled external adapters, presentation fallbacks, generic type bridges, and compatibility fallbacks
  • candidates changed: 6 scanner records across 3 semantic cleanups

Files Changed

  • turbo/apps/api/src/signals/services/zero-runs-create.service.ts: normalizes nullable agent modelProviderId and selectedModel values through an explicit helper before passing optional run settings. This is safe because zeroAgents stores these fields as nullable database columns while CreateAgentRunArgs accepts omitted optional strings; command-level overrides still take precedence.
  • turbo/apps/api/src/signals/services/zero-integrations-slack-message.service.ts: replaces fallback chains in internal agent/run row resolvers with explicit missing-row and null checks. This preserves existing outputs, including non-null zeroAgents.name fallback and undefined for missing selected model.

Verification

  • node /home/user/.codex/skills/ai-slop-fallback-cleanup/scan-ai-slop-fallbacks.mjs /home/user/workspace/vm0 --out /tmp/ai-slop-fallback-scan-after.json confirmed no remaining high-confidence actionable records in touched files; total high-confidence production-actionable records dropped from 223 to 217.
  • git diff --check
  • pnpm -F api check-types could not run in this fresh clone because node_modules is absent and tsc is unavailable; the PR pipeline will run dependency-backed checks.

This workflow intentionally leaves the remaining candidates for later daily runs.

@e7h4n

e7h4n commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

LGTM

PR_AUTO_REVIEW_COMMIT: 0d0d183
PR_AUTO_REVIEW_VERDICT: LGTM

Summary

This PR makes nullable database boundaries explicit for zero run model settings and Slack message footer resolution. The command-over-agent precedence is preserved, and nullable DB values are normalized before optional API fields are populated.

Findings

Critical (P0)

  • None.

High Priority (P1)

  • None.

Testing

  • Coverage: Adequate for a behavior-preserving refactor; no new feature or bug-fix behavior requires new integration coverage.
  • Conventions: Compliant. The PR does not add tests, mocks, ccstate signal changes, API contract changes, or persisted JSONB shape changes.
  • Verification noted in the PR: after-scan removed the targeted high-confidence records from touched files and git diff --check passed. Local API type-checking was not available in the fresh clone because dependencies were not installed; CI remains responsible for dependency-backed checks.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

API preview: https://pr-20734-api.vm6.ai

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ervices/zero-integrations-slack-message.service.ts 66.66% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@e7h4n e7h4n added this pull request to the merge queue Jul 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 8, 2026
@e7h4n e7h4n added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 78f57d7 Jul 8, 2026
92 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in VM0 Kanban Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant