prompt_navigator 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6048f0c756e33afecbdcc501fdf638c7ac51ba11197176b584359aa34a154dbb
4
- data.tar.gz: 890f36b11b51e3b9baaa4a8f847942693970465ef1178707941174dcb5aafe37
3
+ metadata.gz: d596c5be7dbf5ef6bec487f6078e337a718bbdfaf7124fdb93b2d23f275cfbd9
4
+ data.tar.gz: 1c2879a0ab667b2536f98e1d0173ad2fc08ba96108475bc6b001a90b9d73de1d
5
5
  SHA512:
6
- metadata.gz: b9f3de1fb1aaf8522c813546345b9e9c59f2ee1717a708c873877fc8d0673b0df08c617678158430abadbe8be6ecf70d66580386cc279a471084d2ee98a8bbac
7
- data.tar.gz: 84f615f59d04e9cb38129bbb103f64ace2b1484fca97485771333d3361e51cad369bc9d58484544254f0e40ec57e93fd8f0e5eca9f77f19602c1d8bd205ead44
6
+ metadata.gz: 0d99e1a69902fca5890e27e483aa7b058a1f8a5235a649885576acbd7f2387d7c679c9440b3527f00f4d2e0ec5a1142bc7a28fd5e0c1be5ab77a2f247ad8b1e4
7
+ data.tar.gz: 9926f7f7d70f38209bab66dd762566ef1d3f2ed185e65962653866df1570174bff60791608a629367fe66ed7b4ae661f6e30d445dbe74a490761526035c9df1a
@@ -19,6 +19,17 @@ module PromptNavigator
19
19
 
20
20
  before_create :set_execution_id
21
21
 
22
+ # What the sidebar shows for this turn.
23
+ #
24
+ # `model_label` is captured when the turn is written, so it keeps saying
25
+ # "Gemini 2.5 Flash Image (Nano Banana)" after that model leaves the host's
26
+ # catalog. Rows written before the column existed fall back to resolving
27
+ # against the live config, which is the old behaviour — the platform name
28
+ # once the model is gone.
29
+ def display_label
30
+ model_label.presence || PromptNavigator.label_for(platform: llm_platform, model: model)
31
+ end
32
+
22
33
  # Builds a context array from the direct lineage for summarization.
23
34
  # Each entry contains { prompt:, response: } from ancestor PromptExecutions.
24
35
  # Optionally limit to the most recent N ancestors.
@@ -43,7 +43,7 @@
43
43
  <% end %>
44
44
  <% end %>
45
45
  <% if ann.llm_platform.present? %>
46
- <% platform_label = PromptNavigator.label_for(platform: ann.llm_platform, model: ann.model) %>
46
+ <% platform_label = ann.display_label %>
47
47
  <% tooltip = ann.model.present? ? "#{ann.model} (#{ann.llm_platform})" : ann.llm_platform.to_s %>
48
48
  <span class="history-card-platform-label" data-platform="<%= ann.llm_platform %>" title="<%= tooltip %>"><%= platform_label %></span>
49
49
  <% end %>
@@ -18,6 +18,7 @@ module PromptNavigator
18
18
  def add_migrations
19
19
  migration_template "db/migrate/20260129073026_create_prompt_navigator_prompt_executions.rb", "db/migrate/create_prompt_navigator_prompt_executions.rb"
20
20
  migration_template "db/migrate/20260913000000_add_prompt_navigator_supplements.rb", "db/migrate/add_prompt_navigator_supplements.rb"
21
+ migration_template "db/migrate/20261007000000_add_model_label_to_prompt_navigator_prompt_executions.rb", "db/migrate/add_model_label_to_prompt_navigator_prompt_executions.rb"
21
22
  end
22
23
  end
23
24
  end
@@ -0,0 +1,14 @@
1
+ # The catalog's display name for the model that answered, captured when the turn
2
+ # is written.
3
+ #
4
+ # Without it the sidebar resolves a label from the host's LIVE model catalog, so
5
+ # a turn's label depends on whether that model is still offered today. Retiring a
6
+ # model silently downgraded every past turn that used it to the platform name:
7
+ # on one production history, 350 of 520 turns had already decayed that way,
8
+ # including Ollama-hosted ones showing "Ollama" — the exact case the per-model
9
+ # label exists to fix. A history row has to carry what it needs.
10
+ class AddModelLabelToPromptNavigatorPromptExecutions < ActiveRecord::Migration[8.1]
11
+ def change
12
+ add_column :prompt_navigator_prompt_executions, :model_label, :string
13
+ end
14
+ end
@@ -33,6 +33,19 @@ module PromptNavigator
33
33
  yield config
34
34
  end
35
35
 
36
+ # The registered label for this model, or nil when none is known.
37
+ #
38
+ # Deliberately NOT falling back to the platform name: a caller that wants to
39
+ # PERSIST a label needs to tell "the catalog calls this Qwen3.6 35B" from
40
+ # "nothing is registered, so you are seeing the platform". Writing the fallback
41
+ # into a history row would freeze a worse label than the host may know later.
42
+ def self.model_label_for(model)
43
+ key = model.to_s
44
+ return nil if key.empty?
45
+
46
+ config.model_labels[key]
47
+ end
48
+
36
49
  # Resolution order: per-model override → per-platform → raw platform string.
37
50
  # Returns "" only when both inputs are blank.
38
51
  def self.label_for(platform:, model: nil)
@@ -1,3 +1,3 @@
1
1
  module PromptNavigator
2
- VERSION = "2.5.1"
2
+ VERSION = "2.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prompt_navigator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler
@@ -61,6 +61,7 @@ files:
61
61
  - lib/generators/prompt_navigator/modeling/modeling_generator.rb
62
62
  - lib/generators/prompt_navigator/modeling/templates/db/migrate/20260129073026_create_prompt_navigator_prompt_executions.rb
63
63
  - lib/generators/prompt_navigator/modeling/templates/db/migrate/20260913000000_add_prompt_navigator_supplements.rb
64
+ - lib/generators/prompt_navigator/modeling/templates/db/migrate/20261007000000_add_model_label_to_prompt_navigator_prompt_executions.rb
64
65
  - lib/prompt_navigator.rb
65
66
  - lib/prompt_navigator/configuration.rb
66
67
  - lib/prompt_navigator/engine.rb