completion-kit 0.17.0 → 0.17.1

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: 971ebc337d2fa495fc31e82e98428aaee6f007ab3353f61d560df95f0cd15f78
4
- data.tar.gz: 6aaa974cef5da25388cc19c4f3ce34b0c0b9fe447523c4430a7ac313351d3035
3
+ metadata.gz: e35865036a3c24bd7cea9332a734af90d031b8c9d1b8d6b23b0694322fc248fe
4
+ data.tar.gz: 16202eef750b6b0e233456eedff06429d23634f325de5bde2a2ff8d9598108e0
5
5
  SHA512:
6
- metadata.gz: 6db71b9dfddb72596ec78ec9dd1c012b541e384680d71763cc2e753f11df2c734e9d74f2b30613f00f3aaf5697fd5d4b28125fe728294aa1220986363545a495
7
- data.tar.gz: 3dafbf56819d71a56d6b346002feba0bfc5b84eb019e618d3607dfb857996d0e0132c24086198c95b73dfcffa6002a3bb82366ea14be5bb3bb136284c6292b85
6
+ metadata.gz: a9112f5dcc7419ac0f6f6cc2f375b40bcd2d4d40e9d7fb4ca3b45899a51ff611234ef1ecfa6f64c4eecefbb43ac5e5bb4e2ab9edace0b531d1b3cf963adb2fdc
7
+ data.tar.gz: 9a3f51f1754b0d60475c7f5b2c72c6bc0f8cdd2bfa00240aca7d2c5afdac91acf105cd2fddd103b29f4d0c0da9c846ddc752f068f409a4b257f1e9f9016199d0
data/README.md CHANGED
@@ -279,11 +279,11 @@ CompletionKit.configure do |config|
279
279
  end
280
280
  ```
281
281
 
282
- `runs_display_scope` is a callable evaluated against a `Run` relation, in the same bare-`where` style as `tenant_scope` (it runs via `instance_exec`, so write it zero-arg with the relation as `self`, like a Rails `scope` lambda). It must return a relation: a callable that returns `nil` or anything non-chainable raises when a list renders. The engine applies it through `Run.display_scoped` at every run list and count it owns (the runs index, prompt and dataset show pages, the compare picker, new-run tag defaults, the v1 API index and its `X-Total-Count`, the MCP `runs_list` tool, the API reference recent-runs panel, and provider-credential usage stats) and through `Run.visible_run_ids` for child records that traverse runs (the metric trust-panel sample and the agreement examples shown on a metric page). Use it for list-only retention rather than a global `default_scope`, which would null `Run` associations everywhere they are traversed.
282
+ `runs_display_scope` is a callable evaluated against a `Run` relation, in the same bare-`where` style as `tenant_scope` (it runs via `instance_exec`, so write it zero-arg with the relation as `self`, like a Rails `scope` lambda). It must return a relation: a callable that returns `nil` or anything non-chainable raises when a list renders. The engine applies it through `Run.display_scoped` at every run list and count it owns (the runs index, prompt and dataset show pages, the compare picker, new-run tag defaults, the v1 API index and its `X-Total-Count`, the MCP `runs_list` tool, the dashboard and API reference recent-runs panels, the dashboard "Runs" stat-card count, and provider-credential usage stats) and through `Run.visible_run_ids` for child records that traverse runs (the metric trust-panel sample and the agreement examples shown on a metric page). Use it for list-only retention rather than a global `default_scope`, which would null `Run` associations everywhere they are traversed.
283
283
 
284
- Deliberately exempt, because they must still see every run: id-addressed single-run lookups (`runs#show`, the MCP `runs_get` tool, the v1 API show), delete-confirmation cascade counts, the auto-generated run-name counter, and the judge few-shot seeding that learns from corrected examples even on hidden runs.
284
+ Deliberately exempt, because they must still see every run: id-addressed single-run lookups (`runs#show`, the MCP `runs_get` tool, the v1 API show), delete-confirmation cascade counts, the auto-generated run-name counter, the dashboard's stat-card gate (it keys off the unscoped run total so a long-tenured workspace whose runs have all aged past retention still sees its activity cards rather than a blank dashboard), and the judge few-shot seeding that learns from corrected examples even on hidden runs.
285
285
 
286
- `runs_display_footer_partial` names a partial rendered below the runs list on the index and the prompt and dataset show pages; it receives the shown runs as a `runs` local. Use it for a notice like "older runs are hidden, upgrade to see them" — your host owns the retention rule in `runs_display_scope`, so it computes the hidden count itself. Both default to `nil` (no-ops), leaving standalone behaviour unchanged.
286
+ `runs_display_footer_partial` names a partial rendered below the runs list on the dashboard, the index, and the prompt and dataset show pages; it receives the shown runs as a `runs` local. Use it for a notice like "older runs are hidden, upgrade to see them" — your host owns the retention rule in `runs_display_scope`, so it computes the hidden count itself. Both default to `nil` (no-ops), leaving standalone behaviour unchanged.
287
287
 
288
288
  ## Contributing
289
289
 
@@ -4,12 +4,12 @@ module CompletionKit
4
4
  return redirect_to(onboarding_path) unless workspace_ready?
5
5
 
6
6
  @prompt_count = Prompt.current_versions.count
7
- @run_count = Run.count
7
+ @run_count = Run.display_scoped.count
8
8
  @dataset_count = Dataset.count
9
9
  @metric_count = Metric.count
10
- @recent_runs = Run.order(created_at: :desc).limit(5)
10
+ @recent_runs = Run.display_scoped.order(created_at: :desc).limit(5)
11
11
 
12
- return unless @run_count > 5
12
+ return unless Run.count > 5
13
13
 
14
14
  @activity = DashboardStats.activity
15
15
  @worst_metric = DashboardStats.worst_metric(since: 7.days.ago)
@@ -88,4 +88,6 @@
88
88
  <% else %>
89
89
  <div class="ck-empty">No runs yet.&ensp;<%= link_to "Create your first run →", new_run_path, class: "ck-link" %></div>
90
90
  <% end %>
91
+
92
+ <%= ck_runs_display_footer(@recent_runs) %>
91
93
  </section>
@@ -1,3 +1,3 @@
1
1
  module CompletionKit
2
- VERSION = "0.17.0"
2
+ VERSION = "0.17.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: completion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Bastin