Fix noisy cluster labels in hackathon dashboard clustering
Session from hackathon-advisor-codex-traces on Hugging Face by build-small-hackathon · Apache-2.0 · condensed by Coders Talk
The developer asked how the dashboard's project clusters were chosen, then pushed back that the resulting labels (dominated by generic terms like 'US') were unusable and asked for the clustering/labeling logic to be fixed.
- +0Prompt · +0How were these clusters selected? (asking about cluster labels shown in a dashboard screenshot)
- +0mAgent did · +0mExplored the codebase (dashboard.py, data.py, app.js, tests, cached dashboard.json runs) to trace how cluster keywords/labels are generated from project embeddings and TSNE/KMeans clustering.
- +8mPrompt · +8m為何會有一堆 US?我覺得目前選出來的這些根本不能用啊!這個 hackathon 基本上都是這些東西啊。 (Why are there so many 'US' labels? These cluster labels are useless — the hackathon is basically all these words.)
- +8mAgent did · +8mDug into dashboard_storage.py, app.py, and the dashboard/test files to find where cluster keyword labels are computed and why generic/common words were surfacing as cluster labels.
- +11mAgent did · +11mPatched dashboard.py to add a CLUSTER_LABEL_ALGORITHM constant and new distinctive-keyword based labeling logic (53 lines added).
- +11mFail · +11mRunning the new code via python3.11 and pytest failed (exit code 1) — likely wrong interpreter/venv mismatch.
- +11mAgent did · +11mSwitched to .venv/bin/python for verification scripts and pytest; tests passed. Reviewed the diff on dashboard.py to confirm the new labeling behavior.
- +12mAgent did · +12mExpanded the stopword list (added 'before' and others) and extended validate_dashboard_payload, then added tests in test_dashboard.py covering the new distinctive-keyword algorithm and a noisy-cluster scenario.
- Break · 1h 43m away, not counted
- +16mIntervention · +16mDeveloper said 'continue' after the agent paused mid-fix.Why: I just wanted it to keep going with the fix rather than stop and check in.
- +18mOutcome · +18mFull test suite (tests/test_dashboard.py, tests/test_app.py, and the whole pytest run) passed after the new distinctive-keyword cluster labeling was implemented and verified.
Next time I'd open with the real complaint upfront — that cluster labels were dominated by generic/common words like 'US' and were unusable — instead of first asking how they were chosen, since that led to a lot of exploration before we got to the actual fix. The correction that mattered was switching to distinctive-keyword based labeling with an expanded stopword list, verified by running the tests through the project's actual .venv instead of the system python3.11, which had been silently failing.