fix: add confidence gate to dashboard publishable count (MUSE-6) [Dani Roxberry] - #3
fix: add confidence gate to dashboard publishable count (MUSE-6) [Dani Roxberry]#3nebula-ai-agent[bot] wants to merge 1 commit into
Conversation
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>
62a5b10 to
150ce48
Compare
There was a problem hiding this comment.
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
Summary
The dashboard "Ready To Publish" metric was counting items with
state === "approved"and no risk flags, butpublishListing()also enforcesconfidence >= 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.75to the filter inapps/admin-web/src/app/page.tsxline 11, matching the business-logic gate inapps/admin-web/src/lib/workflows.tsline 52.Testing
apps/admin-web/tests/workflows.test.tsshould still passRequested by Dani Roxberry via Nebula.
— opened via Nebula by Dani Roxberry (@droxey)