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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e35865036a3c24bd7cea9332a734af90d031b8c9d1b8d6b23b0694322fc248fe
|
|
4
|
+
data.tar.gz: 16202eef750b6b0e233456eedff06429d23634f325de5bde2a2ff8d9598108e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
|
12
|
+
return unless Run.count > 5
|
|
13
13
|
|
|
14
14
|
@activity = DashboardStats.activity
|
|
15
15
|
@worst_metric = DashboardStats.worst_metric(since: 7.days.ago)
|