What Is the Non-Obvious Pick in ADHD and How Is It Selected?
The non-obvious pick is the highest-novelty idea selected from the top-scoring shortlist, ensuring the ADHD (Agile Divergent-Hypothesis-Design) engine surfaces at least one surprising yet viable solution among its recommendations.
ADHD is an open-source ideation engine that generates divergent candidate solutions for complex problems. The non-obvious pick serves as a specialized output field within the RunResult object, designed to highlight the most innovative option that still meets viability thresholds. Understanding this selection mechanism helps developers leverage the engine for creative problem-solving while maintaining practical constraints.
How the Non-Obvious Pick Algorithm Works
The selection process operates in three distinct phases: composite scoring, shortlisting, and novelty extraction.
Phase 1: Quantitative Scoring
Every idea generated by the ADHD engine receives a Score object defined in src/types.ts (lines 12‑18). This object contains three quantitative dimensions rated on a 0‑10 scale:
- novelty – measures distance from obvious or conventional solutions
- viability – assesses realistic implementation potential
- fit – evaluates alignment with the original problem statement
These three values combine into a total weight that drives the initial ranking. The RunResult interface (lines 31‑33) explicitly types the nonObviousPick field as an optional Idea object, allowing for null when no candidates qualify.
Phase 2: Shortlisting Top Candidates
The engine sorts the entire candidate pool by total score in descending order, then extracts the top 2‑4 ideas for further evaluation. According to src/engine.ts (lines 382‑385), the shortlist size dynamically adjusts based on the topK parameter:
const ranked = allIdeas
.sort((a, b) => (b.score!.total - a.score!.total));
const shortlist = ranked.slice(0, Math.max(2, Math.min(4, topK + 1)));
This ensures the shortlist always contains between 2 and 4 of the highest-scoring ideas, regardless of the total candidate volume.
Phase 3: Selecting the Most Novel Idea
From the shortlist, the engine performs a secondary sort using only the novelty dimension. As implemented in src/engine.ts (line 414), the algorithm checks for an empty shortlist, then re-sorts by novelty descending to extract the winner:
const nonObviousPick =
shortlist.length === 0
? null
: [...shortlist]
.sort((a, b) => b.score!.novelty - a.score!.novelty)[0];
If the shortlist contains no entries, the field returns null; otherwise, it returns the first element of the novelty-sorted array.
Implementation Details in the Source Code
The core selection logic lives in src/engine.ts, where the engine composes the final RunResult object. The algorithm guarantees that the non-obvious pick represents the intersection of high performance (via the initial total-score ranking) and high innovation (via the secondary novelty sort).
To access this field after running the engine:
import { run } from "./src/llm";
const result = await run({
problem: "Design a thread-safe LRU cache that survives process restart",
topK: 3,
ideasPerFrame: 6,
});
if (result.nonObviousPick) {
console.log("Selected idea:", result.nonObviousPick.text);
console.log("Novelty score:", result.nonObviousPick.score?.novelty);
}
Displaying the Non-Obvious Pick in the UI
The ADHD CLI and renderers highlight this special idea with a visual marker. In src/render.ts (line 53), the code prefixes the non-obvious pick with a green star (★) to distinguish it from other candidates:
const mark = r.nonObviousPick?.id === i.id ? green("★ non-obvious pick → ") : " ";
This visual cue allows users to immediately identify which recommendation offers the most divergent thinking while maintaining viability.
Summary
- The non-obvious pick is defined in
src/types.tsas an optional property of theRunResultinterface. - Selection occurs in
src/engine.tsthrough a two-stage sorting process: first by total score (viability × fit × novelty), then by novelty alone within the top 2‑4 candidates. - The algorithm returns
nullwhen the shortlist is empty, ensuring type safety downstream. - UI components in
src/render.tsmark this idea with a star (★) for immediate visual recognition. - This mechanism guarantees that every successful run surfaces at least one solution that is both feasible and genuinely surprising.
Frequently Asked Questions
What happens if no viable ideas are generated?
If the shortlist array is empty after the initial ranking phase, the nonObviousPick field is set to null according to the logic in src/engine.ts. This prevents the engine from recommending low-quality ideas when the candidate pool fails to meet basic viability thresholds.
How is novelty calculated in ADHD?
The novelty score is a quantitative dimension (0‑10) assigned during the scoring phase based on how far the idea deviates from obvious or conventional approaches. While the exact heuristic depends on the LLM evaluator configuration, the Score type in src/types.ts enforces this as a required numeric field used specifically for the non-obvious pick selection.
Can I adjust the shortlist size?
Yes. The shortlist size dynamically scales with the topK parameter passed to the run() function. The engine constrains the slice to between 2 and 4 ideas using Math.max(2, Math.min(4, topK + 1)), ensuring sufficient diversity for the novelty comparison without overwhelming the secondary sort phase.
Is the non-obvious pick always different from the top-ranked idea?
Not necessarily. If the highest-scoring idea (by total weight) also possesses the highest novelty score within the shortlist, it will be selected as both the top-ranked idea and the non-obvious pick. However, when these dimensions diverge, the non-obvious pick explicitly surfaces a lower-ranked but more innovative alternative from the viable candidate set.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →