Commit Graph

3074 Commits

Author SHA1 Message Date
Claudio Ortolina 2c6e6e7ca2 Return matching_records list from top_albums_attach_metadata
Apply the same release-group JSON aggregation pattern to top albums
queries. Add JSON parsing in get_top_albums/1 and
get_top_albums_by_days/2.
2026-04-14 16:05:51 +01:00
Claudio Ortolina cfd267627c Return matching_records list from tracks_with_record_info_query
Replace scalar collected_record_id/wishlisted_record_id subqueries with
a single matching_records JSON array grouped by release group
(records.musicbrainz_id). Add parse_matching_records/1 for JSON parsing
and derive_legacy_record_ids/2 as a temporary bridge for existing
templates. Update tests to use shared musicbrainz_id fixtures.
2026-04-14 14:17:02 +01:00
Claudio Ortolina 9f4135661e Replace scalar record IDs with matching_records JSON array in tracks query
Replaces collected_record_id and wishlisted_record_id correlated
subqueries in tracks_with_record_info_query with a single
matching_records json_group_array subquery that returns all records
sharing the same release ID. Adds parse_matching_records/1 for JSON
deserialization. Updates recent_activity/2 and list_tracks/1 to parse
the JSON at the boundary. Derives legacy collected_record_id and
wishlisted_record_id from matching_records so existing LiveViews keep
working. The get_top_albums test is temporarily skipped pending the
top_albums_attach_metadata update.
2026-04-14 14:12:14 +01:00
Claudio Ortolina 4f1e596c5c Update typst from 0.3.3 to 0.3.4 2026-04-14 11:08:24 +01:00
Claudio Ortolina e43bccb9bc Extract shared index logic into LiveHelpers.IndexActions
Closes #150
2026-04-13 23:09:22 +01:00
Claudio Ortolina 4fa13d5422 Reset chat state when navigating between entities
The Chat component kept stale messages and chat references
when patching to a different artist/record because update/2
only refreshed the chat list, not the active chat state.
2026-04-13 18:32:19 +01:00
Claudio Ortolina 6a6410bcaa Have the LLM use square bracketed links for internal references 2026-04-13 14:24:36 +01:00
Claudio Ortolina 96bb0fc403 Try and control ChatGPT's tone and "helpfulness" 2026-04-13 14:09:43 +01:00
Claudio Ortolina e10df1985e Reuse binding in test 2026-04-13 13:34:23 +01:00
Claudio Ortolina b422cccf09 Make format merge assertion order-independent 2026-04-13 13:17:03 +01:00
Claudio Ortolina 726b7d5ef8 Add tests for chat auto-open via query param 2026-04-13 13:16:28 +01:00
Claudio Ortolina f7628267b3 Add @moduledoc to OpenAI.API 2026-04-13 13:15:43 +01:00
Claudio Ortolina a1b775f0ae Fix architecture docs to reflect gpt-5.1 for CollectionChat 2026-04-13 13:15:10 +01:00
Claudio Ortolina bdc1cd3992 Prevent callback return value from halting stream
The delta branch in decode_responses_event now explicitly returns
:ok after invoking the callback, so a callback returning {:error, _}
cannot be mistaken for a stream-level error by decode_events.
2026-04-13 13:14:33 +01:00
Claudio Ortolina 846b92fd4c Add tests for streaming error events in OpenAI.API
Covers error event mid-stream, response.failed events, halt
behavior after errors, and unexpected event type logging.
2026-04-13 13:13:51 +01:00
Claudio Ortolina 6fa640f0f6 Remove unreachable catch clause in do_chat_stream 2026-04-13 13:12:58 +01:00
Claudio Ortolina 9b44b7050f Count unique catalog entries in collection summary
The record_count now reflects the number of grouped catalog lines
the model sees, not raw DB rows. Two copies of the same album on
different formats count as 1 catalog entry.
2026-04-13 13:12:30 +01:00
Claudio Ortolina 76438360d7 Load collection summary asynchronously on mount 2026-04-13 13:11:15 +01:00
Claudio Ortolina 5512ac0837 Hide button text on mobile 2026-04-13 12:53:57 +01:00
Claudio Ortolina 54dab5fbdf Use gpt 5.1 to cater for collection summary context size 2026-04-13 12:43:42 +01:00
Claudio Ortolina f9448cac6f Revert "Use smaller model so that we don't exhaust tokens"
This reverts commit 9c0e11bc84.
2026-04-13 12:34:17 +01:00
Claudio Ortolina 8108645718 Shrink collection summary to fit OpenAI token limit
Deduplicate records by musicbrainz_id (merging formats)
and cap genres to 3 per record, reducing the summary from
~32K to ~24K estimated tokens.
2026-04-13 12:33:15 +01:00
Claudio Ortolina ac1954f9c8 Document ExSlop Credo checks convention 2026-04-13 12:18:17 +01:00
Claudio Ortolina 50407f154e Update architecture docs for Collection Chat 2026-04-13 12:17:27 +01:00
Claudio Ortolina 9c0e11bc84 Use smaller model so that we don't exhaust tokens 2026-04-13 12:06:24 +01:00
Claudio Ortolina f73be3f881 Handle OpenAI api streaming error messages 2026-04-13 11:54:05 +01:00
Claudio Ortolina e0ad83a774 Update gettext translations for collection chat 2026-04-13 10:17:03 +01:00
Claudio Ortolina 3b8415d8c4 Add Collection Chat to universal search 2026-04-13 10:15:43 +01:00
Claudio Ortolina a509248625 Wire up Chat component in CollectionLive.Index 2026-04-13 10:12:49 +01:00
Claudio Ortolina 34f484cc81 Add CollectionChat StreamProvider 2026-04-13 10:09:50 +01:00
Claudio Ortolina 24a3cc9265 Add Collection.collection_summary/0 2026-04-13 10:08:01 +01:00
Claudio Ortolina d845ab93dd Add collection sentinel UUID to Chats context 2026-04-13 10:06:16 +01:00
Claudio Ortolina 55be2a4bab Add :collection to chat entity enum 2026-04-13 10:04:37 +01:00
Claudio Ortolina 399c4e4a2a Remove empty packages from ui-framework usage rules 2026-04-13 08:29:38 +01:00
dependabot[bot] 14d318923c Update usage_rules from 1.2.5 to 1.2.6
Updates [usage_rules](https://github.com/ash-project/usage_rules) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/ash-project/usage_rules/releases)
- [Changelog](https://github.com/ash-project/usage_rules/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ash-project/usage_rules/compare/v1.2.5...v1.2.6)

---
updated-dependencies:
- dependency-name: usage_rules
  dependency-version: 1.2.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 08:28:48 +01:00
Claudio Ortolina 035b4e7197 Extract shared record action menu component
Closes #155
2026-04-12 23:23:11 +01:00
Claudio Ortolina 88906e10ad Add ex_slop, configure it, run it and fix issues 2026-04-12 22:07:27 +01:00
Claudio Ortolina 9370e5f64d No need to use a case 2026-04-12 22:05:09 +01:00
Claudio Ortolina 834226921e Update production infrastructure docs 2026-04-12 12:46:51 +01:00
Claudio Ortolina b95cfd6e43 Validate Docker builder image on CI 2026-04-12 12:42:42 +01:00
Claudio Ortolina ae262352c6 Add shellcheck to CI lint job 2026-04-12 12:33:02 +01:00
Claudio Ortolina 4a8af7be39 Move lint, precommit, shellcheck from mix aliases to mise scripts
Mix aliases should only compose mix tasks. Shell tool orchestration
(shellcheck, fd) belongs in mise scripts. This removes the mix cmd
escape hatch and makes the boundary clear: mix.exs for pure mix
composition, scripts/ for cross-toolchain orchestration.
2026-04-12 12:30:59 +01:00
Claudio Ortolina 65135a618d Add script/command to validate Dockerfile args versions 2026-04-12 12:10:34 +01:00
Claudio Ortolina 9c7ab5b229 Add Claude Code hooks, commands, and permissions
High priority:

- Auto-format on edit (.claude/hooks/format-elixir.sh): runs mix format
  synchronously after every Edit/Write on .ex, .exs, and .heex files.
  Ensures code is formatted before the next read or tool call.

- mix test permissions: added Bash(mix test) (bare) and Bash(mix test *)
  (with path/flags) to the allow list. Previously only Bash(mix test:*)
  was allowed, which didn't match common invocations.

- Slash commands: /precommit runs the full mix precommit pipeline and
  reports failures with fix suggestions. /oban-status queries Oban job
  state via Tidewave SQL, grouped by state and worker.

Medium priority:

- Chrome DevTools permissions: added 8 new tools (select_page,
  list_network_requests, get_network_request, list_console_messages,
  get_console_message, hover, press_key, wait_for) for debugging API
  traffic, JS hook errors, hover states, and keyboard navigation.

- Gettext extraction hook (.claude/hooks/gettext-extract.sh): runs
  mix gettext.extract --merge asynchronously after editing .heex files.
  Async because it's project-wide and doesn't need to block the next edit.

- Sobelow permission: added Bash(mix sobelow:*) to the allow list for
  independent security checks.
2026-04-12 09:54:32 +01:00
Claudio Ortolina e498dccde5 Provide sqlite3 console command
- Loads extensions
- Wraps with rlwrap for convenience
2026-04-12 07:36:07 +01:00
Claudio Ortolina ea9886a647 Update Erlang to 28.4.2 2026-04-12 07:16:14 +01:00
Claudio Ortolina 02761428c1 Format map and list query params as JSON 2026-04-11 23:57:40 +01:00
Claudio Ortolina a983698c72 Document SQLite query optimization conventions 2026-04-11 23:46:23 +01:00
Claudio Ortolina 1c8d63c4d7 Bump Docker image versions in production docs 2026-04-11 23:46:06 +01:00
Claudio Ortolina 754a71cf70 Update dependencies
igniter 0.7.8 => 0.7.9
2026-04-11 23:39:00 +01:00