Skip to content

Atmosphere triptych — 3 curated picks with variety engine - #76

Merged
danmunz merged 2 commits into
mainfrom
feat/atmosphere-triptych
Jun 4, 2026
Merged

Atmosphere triptych — 3 curated picks with variety engine#76
danmunz merged 2 commits into
mainfrom
feat/atmosphere-triptych

Conversation

@danmunz

@danmunz danmunz commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Replaces the single-recommendation Atmosphere modal with a 3-card triptych layout. Closes #65.

What changed

Backend (server.py)

  • Rewrote ATMOSPHERE_PROMPT to request 3 ranked picks with lateral-thinking guidance
  • Added recommendation history file (atmosphere_history.json) tracking picks over time
  • Inverse-frequency weighted pre-filter samples ~20 candidates, avoiding repeats
  • random.shuffle() eliminates insertion-order bias in LLM context
  • temperature: 0.9 and max_tokens: 600 for atmosphere calls only
  • Fallback padding ensures 3 recommendations even if the LLM returns fewer

Frontend (index.html)

  • 3-card triptych layout (820px max-width, responsive column stack at ≤600px)
  • First card marked "Curator's pick" with accent top-border
  • Staggered reveal animation (150ms intervals)
  • Each card: thumbnail, wiki-linked title, curator note, vibe pills, Display button
  • "Explored N of M" counter below cards
  • atmosphereRetry() excludes all 3 picks at once
  • localStorage persistence with 24h TTL for exclusion list
  • closeAtmosphere() no longer clears exclusions — reopening continues where you left off

Tests

  • Updated test_full_pipeline for 3-recommendation response schema
  • New test_fallback_padding — LLM returns 1 valid pick, response padded to 3
  • New test_history_persistence — verifies history file accumulates across calls
  • Updated XSS test for safeTitle variable in pick cards

All 122 tests pass (6 xfailed).

Replaces single-recommendation Atmosphere modal with a 3-card triptych:

Backend:
- New ATMOSPHERE_PROMPT requesting 3 ranked picks with lateral-thinking guidance
- Recommendation history file (atmosphere_history.json) tracking picks over time
- Inverse-frequency weighted pre-filter samples ~20 candidates, avoiding repeats
- random.shuffle() eliminates insertion-order bias in LLM context
- temperature 0.9 and max_tokens 600 for atmosphere calls only
- Fallback padding ensures 3 recommendations even if LLM returns fewer

Frontend:
- 3-card triptych layout (820px max-width, responsive stack at <=600px)
- First card marked Curators pick with accent top-border
- Staggered reveal animation (150ms intervals)
- Each card: thumbnail, wiki-linked title, curator note, vibe pills, Display button
- Explored N of M counter below cards
- atmosphereRetry() excludes all 3 picks at once
- localStorage persistence with 24h TTL for exclusion list
- closeAtmosphere() no longer clears exclusions

Tests:
- Updated test_full_pipeline for 3-recommendation response schema
- New test_fallback_padding and test_history_persistence
- Updated XSS test for safeTitle variable in pick cards

Closes #65

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb607cc0a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server.py Outdated
Track used_ids during LLM result parsing to skip duplicate content_ids
before the padding step. Prevents duplicate cards when the model returns
the same artwork more than once.

Adds test_dedup_repeated_ids to verify 3 unique picks are returned even
when the LLM repeats an ID.
@danmunz
danmunz merged commit 342f01b into main Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant