proactive-gate 0.2.4 → 0.2.5
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.
- package/README.md +32 -15
- package/README.tr.md +56 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ English | [Türkçe](README.tr.md)
|
|
|
9
9
|
<img src="https://img.shields.io/bundlephobia/minzip/proactive-gate?style=flat-square&color=111111" alt="minzipped size">
|
|
10
10
|
<img src="https://img.shields.io/github/stars/Bubblegunn/proactive-gate?style=flat-square&color=111111" alt="stars">
|
|
11
11
|
<img src="https://img.shields.io/badge/license-MIT-111111?style=flat-square" alt="MIT">
|
|
12
|
+
<a href="https://doi.org/10.5281/zenodo.22393512"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.22393512-111111?style=flat-square" alt="DOI"></a>
|
|
12
13
|
</p>
|
|
13
14
|
|
|
14
15
|
Decide whether a proactive AI agent may reach a user right now, and log why not.
|
|
@@ -138,21 +139,23 @@ consumed in check order at commit, so when a weekly check passes and the daily o
|
|
|
138
139
|
refuses, that weekly unit is spent without a delivery. It only happens when two commits
|
|
139
140
|
race after a shared evaluate.
|
|
140
141
|
|
|
141
|
-
###
|
|
142
|
+
### One limit you should know before you adopt this
|
|
142
143
|
|
|
143
|
-
|
|
144
|
+
It is not a bug, and it is pinned by tests so a future change has to be deliberate.
|
|
144
145
|
|
|
145
|
-
**The week is the ISO week, so the weekly budget refills on Monday.**
|
|
146
|
-
week
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
146
|
+
**The week is the ISO week, so the weekly budget refills on Monday.** Monday is not where
|
|
147
|
+
the week starts for most people: of the twenty most populous countries, CLDR gives Monday
|
|
148
|
+
to seven, Sunday to eleven and Saturday to two, which you can read yourself with
|
|
149
|
+
`new Intl.Locale("und-EG").getWeekInfo().firstDay`. Where the working week runs Sunday to
|
|
150
|
+
Thursday, an ISO refill lands one day in: a user who spends the budget on Sunday has it back
|
|
151
|
+
on Monday with four working days still to run. The key is ISO anyway, for two reasons. A
|
|
152
|
+
counter already in your store is keyed by it, and moving the key silently resets every user
|
|
153
|
+
mid-week. And the day the counter turns over is not the day the user is protected on: quiet
|
|
154
|
+
hours already read the user's own weekday, including a Friday or a Shabbat window, and they
|
|
155
|
+
are what decides when a notification is allowed. The budget only decides how many. If the ISO
|
|
156
|
+
week is wrong for your users, pass your own budget check keyed how you like; it is an object
|
|
157
|
+
with an `id` and a `run`, it composes in the order you choose, and the trace will show it
|
|
158
|
+
firing beside the built-in ones.
|
|
156
159
|
|
|
157
160
|
Order is a design decision and it should be visible. Consent has to come before
|
|
158
161
|
everything. Quiet hours have to come before the budget, or a rejected candidate
|
|
@@ -550,8 +553,10 @@ pip install proactive-gate
|
|
|
550
553
|
```
|
|
551
554
|
|
|
552
555
|
To run an unreleased state, install from the repository instead: `pip install "proactive-gate @
|
|
553
|
-
git+https://github.com/Bubblegunn/proactive-gate#subdirectory=python"`. The published
|
|
554
|
-
|
|
556
|
+
git+https://github.com/Bubblegunn/proactive-gate#subdirectory=python"`. The Python package is published by
|
|
557
|
+
the same workflow as the npm one, so it carries PyPI publish attestations naming the repository
|
|
558
|
+
and the workflow that built each file. Releases before 0.2.2 were uploaded from a local build with
|
|
559
|
+
a token and carry none.
|
|
555
560
|
|
|
556
561
|
```python
|
|
557
562
|
from proactive_gate import Gate
|
|
@@ -721,6 +726,18 @@ before. [@aaqib-hafeez-khan-in](https://github.com/aaqib-hafeez-khan-in) wrote `
|
|
|
721
726
|
([#9](https://github.com/Bubblegunn/proactive-gate/pull/9)). Both shipped in 0.1.2 and are in
|
|
722
727
|
every release since, including the one you install today.
|
|
723
728
|
|
|
729
|
+
## Cite this
|
|
730
|
+
|
|
731
|
+
Every release is archived on Zenodo with a DOI, so a paper or a report can point at the
|
|
732
|
+
exact code it ran.
|
|
733
|
+
|
|
734
|
+
[](https://doi.org/10.5281/zenodo.22393512)
|
|
735
|
+
|
|
736
|
+
That is the **concept** DOI: it always resolves to the newest version. To cite the exact
|
|
737
|
+
version you ran, open that page, pick the version in the sidebar, and use the DOI shown
|
|
738
|
+
there. `CITATION.cff` in this repository carries the same identifier, so GitHub's "Cite this
|
|
739
|
+
repository" button produces correct BibTeX and APA without any copying by hand.
|
|
740
|
+
|
|
724
741
|
## Development
|
|
725
742
|
|
|
726
743
|
```
|
package/README.tr.md
CHANGED
|
@@ -81,12 +81,37 @@ olurdu.
|
|
|
81
81
|
| 5 | `snooze()` | `user.snoozedUntil` gelecekteyse | genel duraklatma |
|
|
82
82
|
| 6 | `mute()` | `candidate.type`, `user.mutedTypes` içindeyse | tür bazlı susturma |
|
|
83
83
|
| 7 | `intensity()` | öncelik, kullanıcının yoğunluk tabanının altındaysa | low yalnızca high duyar, normal normal ve üstünü, high her şeyi |
|
|
84
|
-
| 8 | `quietHours({ priorityFloor })` | kullanıcının yerel sessiz penceresi içindeyse | IANA saat dilimi, pencere gece yarısını geçebilir, taban ve üstünde atlanır |
|
|
84
|
+
| 8 | `quietHours({ priorityFloor })` | kullanıcının yerel sessiz penceresi içindeyse | IANA saat dilimi, pencere gece yarısını geçebilir, taban ve üstünde atlanır; her gün tek pencere ya da [güne göre bir çizelge](#güne-göre-değişen-sessiz-saatler) |
|
|
85
85
|
| 9 | `trustRamp({ days, minPriority })` | kullanıcı `days` günden yeniyse ve öncelik tabanın altındaysa | sistem, kullanıcı en az bağışlayıcıyken en az kalibredir |
|
|
86
86
|
| 10 | `dismissalCooldown({ dismissals, withinDays, silenceDays })` | kullanıcı o türü pencere içinde `dismissals` kez reddettiyse | `gate.record(user, candidate, "dismissed")` ile beslenir; her yeni ret sessizliği yeniden başlatır |
|
|
87
87
|
| 11 | `adaptiveTiming({ nextGoodMoment, surfacesFor })` | asla | reddetmez: `deliverAt` değerini taşır ya da yüzeyleri daraltır; `nonRejecting` işaretli bir kontrol istese de reddedemez |
|
|
88
88
|
| 12 | `dailyBudget({ limit, bypassPriority })` | kullanıcının yerel gün sayacı sınırdaysa | `evaluate` okur, `commit` atomik artırır ve yine de reddedebilir |
|
|
89
89
|
|
|
90
|
+
### Güne göre değişen sessiz saatler
|
|
91
|
+
|
|
92
|
+
Çalışma haftası her yerde pazartesiden cumaya değildir ve tatil günü zaten hafta içi
|
|
93
|
+
değildir. `quietHours` tek bir pencerenin yanında bir çizelge de alır:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
quietHours: {
|
|
97
|
+
default: { start: "22:00", end: "08:00" },
|
|
98
|
+
days: { fri: { start: "00:00", end: "23:59" }, sat: { start: "00:00", end: "23:59" }, sun: null },
|
|
99
|
+
dates: { "2026-12-25": { start: "00:00", end: "23:59" } },
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Tarih haftanın gününü, o da varsayılanı yener; `null` o günün sessiz saati yok demektir ve
|
|
104
|
+
varsayılanın içinden bir iş günü böyle oyulur. Bir pencere açıldığı güne aittir, yani gece
|
|
105
|
+
yarısını geçen bir pencere ertesi sabahı susturur ve gerekçe hangi günden geldiğini söyler.
|
|
106
|
+
|
|
107
|
+
Bunun bilerek yapmadığı iki şey var. Gömülü bir tatil takvimi yok: hangi tarihleri
|
|
108
|
+
tuttuğunuz size aittir, gömülü olan ise kimse fark etmeden bayatlar. Ve tek bir satır 24
|
|
109
|
+
saatten fazlasını anlatamaz, yani cuma akşamından cumartesi akşamına uzanan bir sessizlik
|
|
110
|
+
iki satırdır: `fri: 18:00 to 00:00` ve `sat: 00:00 to 20:00`.
|
|
111
|
+
|
|
112
|
+
Tek pencere geçmek eskisi gibi çalışır ve yaygın durum olmayı sürdürür; her günü aynı
|
|
113
|
+
pencereye çıkan bir çizelge, o pencereyle birebir aynı davranır.
|
|
114
|
+
|
|
90
115
|
Sıra bir tasarım kararıdır ve görünür olmalıdır. Rıza her şeyden önce gelmelidir. Sessiz
|
|
91
116
|
saatler bütçeden önce gelmelidir, yoksa reddedilen bir aday hiç yapmadığı bir teslimi
|
|
92
117
|
tüketir. İstediğiniz gibi yeniden sıralayın; iz ne yaptığınızı gösterecektir.
|
|
@@ -227,22 +252,24 @@ işyerinde sürekli ulaşılabilir olmaları beklendiği için katılmayı redde
|
|
|
227
252
|
seçmediği bir sessizliğin bir bedeli var ve o bedel bu kütüphanenin yazdığı hiçbir izde
|
|
228
253
|
görünmüyor.
|
|
229
254
|
|
|
230
|
-
## Benimsemeden önce bilmeniz gereken
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
**Hafta, ISO haftasıdır; haftalık bütçe pazartesi yenilenir.**
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
255
|
+
## Benimsemeden önce bilmeniz gereken bir sınır
|
|
256
|
+
|
|
257
|
+
Hata değil ve testle sabitlendi, böylece ileride değişecekse bilerek değişir.
|
|
258
|
+
|
|
259
|
+
**Hafta, ISO haftasıdır; haftalık bütçe pazartesi yenilenir.** Pazartesi, çoğu insan için
|
|
260
|
+
haftanın başladığı gün değildir: en kalabalık yirmi ülkeden CLDR'ye göre yedisinde
|
|
261
|
+
pazartesi, on birinde pazar, ikisinde cumartesi başlar; bunu kendiniz
|
|
262
|
+
`new Intl.Locale("und-EG").getWeekInfo().firstDay` ile okuyabilirsiniz. Çalışma haftası
|
|
263
|
+
pazardan perşembeye uzanan yerlerde ISO yenilenmesi haftanın birinci gününe denk gelir:
|
|
264
|
+
pazar günü bütçesini harcayan bir kullanıcı pazartesi sabahı bütçesini geri alır ve önünde
|
|
265
|
+
hâlâ dört iş günü vardır. Anahtar yine de ISO, iki nedenle. Deponuzdaki sayaç bu anahtarla
|
|
266
|
+
tutuluyor ve anahtarı taşımak her kullanıcıyı haftanın ortasında sessizce sıfırlar. Ayrıca
|
|
267
|
+
sayacın döndüğü gün, kullanıcının korunduğu gün değildir: sessiz saatler kullanıcının kendi
|
|
268
|
+
haftalık gününü zaten okuyor, cuma ya da Şabat penceresi dahil, ve bildirimin ne zaman
|
|
269
|
+
verilebileceğine onlar karar veriyor. Bütçe yalnız kaç tane olacağına karar verir. ISO
|
|
270
|
+
haftası sizin kullanıcılarınız için yanlışsa kendi bütçe kontrolünüzü istediğiniz anahtarla
|
|
271
|
+
yazın: `id` ve `run` taşıyan bir nesnedir, istediğiniz sırada dizilir ve izde yerleşik
|
|
272
|
+
kontrollerin yanında görünür.
|
|
246
273
|
|
|
247
274
|
## Hazır paketler: platform kotaları ve yasal sınırlar, kaynaklarıyla
|
|
248
275
|
|
|
@@ -463,6 +490,18 @@ başına bir anahtar ve sessiz saati aşan bir öncelik tabanı verir. Horvitz'i
|
|
|
463
490
|
çalışmaları iki isteğe bağlı kontrolü sağladı. Bu paket o fikirleri izli tek bir listeye
|
|
464
491
|
koyar ve onların dışarıda bıraktığı parçayı ekler: gönderim anında tüketilen bütçe.
|
|
465
492
|
|
|
493
|
+
## Atıf
|
|
494
|
+
|
|
495
|
+
Her sürüm Zenodo'da bir DOI ile arşivleniyor, böylece bir makale ya da rapor tam olarak
|
|
496
|
+
çalıştırdığı koda işaret edebiliyor.
|
|
497
|
+
|
|
498
|
+
[](https://doi.org/10.5281/zenodo.22393512)
|
|
499
|
+
|
|
500
|
+
Bu **kavram** DOI'si: her zaman en yeni sürüme çözümlenir. Çalıştırdığınız sürümün kendisini
|
|
501
|
+
atıflamak için o sayfayı açıp yan çubuktan sürümü seçin ve orada yazan DOI'yi kullanın.
|
|
502
|
+
Depodaki `CITATION.cff` aynı tanımlayıcıyı taşıyor, bu yüzden GitHub'ın "Cite this repository"
|
|
503
|
+
düğmesi elle kopyalama olmadan doğru BibTeX ve APA üretiyor.
|
|
504
|
+
|
|
466
505
|
## Geliştirme
|
|
467
506
|
|
|
468
507
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proactive-gate",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Decide whether a proactive AI agent may reach a user right now, and log why not. Ordered checks as code or JSON, a conformance spec, presets for platform and legal limits, adapters for AI SDK, Mastra, LangChain and OpenAI Agents, and a Python sibling.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|