Skip to content

fix: add confidence gate to dashboard publishable count (MUSE-6) [Dani Roxberry] - #3

Open
nebula-ai-agent[bot] wants to merge 1 commit into
mainfrom
LIN-6-confidence-gate-fix
Open

fix: add confidence gate to dashboard publishable count (MUSE-6) [Dani Roxberry]#3
nebula-ai-agent[bot] wants to merge 1 commit into
mainfrom
LIN-6-confidence-gate-fix

Conversation

@nebula-ai-agent

Copy link
Copy Markdown

Summary

The dashboard "Ready To Publish" metric was counting items with state === "approved" and no risk flags, but publishListing() also enforces confidence >= 0.75. This caused the metric to overcount — low-confidence approved items would appear ready but fail at publish time with "Low-confidence items must stay in review."

Fix

Added && item.confidence >= 0.75 to the filter in apps/admin-web/src/app/page.tsx line 11, matching the business-logic gate in apps/admin-web/src/lib/workflows.ts line 52.

Testing

  • Pre-existing tests in apps/admin-web/tests/workflows.test.ts should still pass
  • Manually: items with state=approved, no risk flags, and confidence < 0.75 will no longer increment the metric

Requested by Dani Roxberry via Nebula.

— opened via Nebula by Dani Roxberry (@droxey)

The npm script test:worker invokes .venv/bin/python, but CI was
installing into the system Python. Create a venv first so the
path exists.

Co-authored-by: Dani Roxberry <droxey@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Co-Authored-By: Nebula <noreply@nebula.gg>
@nebula-ai-agent
nebula-ai-agent Bot force-pushed the LIN-6-confidence-gate-fix branch from 62a5b10 to 150ce48 Compare July 18, 2026 10:13

@nebula-ai-agent nebula-ai-agent Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — PR #3

Verification Summary

Check Result Detail
tests PASS 6 vitest + 4 pytest pass locally; CI (web-and-worker, ios-package) green
lint PASS ESLint clean, Ruff clean on worker
scope PASS 2 files, 3 insertions, 2 deletions — directly addresses MUSE-6
security PASS No new deps, no auth changes, no user input handling
ui_behavior N/A Server component data filter; no interactive UI to test

Findings

[MAJOR] Missing test for dashboard filter (apps/admin-web/src/app/page.tsx:11)
The confidence gate && item.confidence >= 0.75 has no test coverage. The only test file (workflows.test.ts) covers publishListing(), but page.tsx has zero tests. Without a test that asserts low-confidence approved items are excluded from the "Ready To Publish" count, this fix is unverified at the integration level.

Expected: A test that exercises the filter with mock data including items where confidence < 0.75, verifying they are excluded.

[MINOR] Filter condition order inconsistency
publishListing() in workflows.ts:46-53 checks confidence FIRST (it is the critical gate that throws). The dashboard filter checks confidence LAST. While functionally equivalent, the ordering is inconsistent. Consider matching: item.state === "approved" && item.confidence >= 0.75 && item.riskFlags.length === 0.

[NIT] Evidence bundle inaccuracy
The evidence bundle at triggers/daily-morning-sweep/state/evidence-pr3.md says the PR has a "CI fix commit (6a8bd9a)" but the PR is a single squashed commit (150ce48) containing both changes. The Files Changed section only lists ci.yml.

Verdict

changes_requested — The confidence gate logic is correct and all existing tests pass, but the new dashboard filter has no test coverage. Add a test that verifies low-confidence approved items are excluded from the "Ready To Publish" metric.

Reviewed by Code Reviewer via Nebula

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants