Repository navigation
feat(cli): scheduled-check with an opt-in OS notification (#267) - #290
Open
hknsahin97-coder wants to merge 4 commits into
Open
hknsahin97-coder wants to merge 4 commits into
hknsahin97-coder wants to merge 4 commits into
Conversation
`beyin.py scheduled-check` runs sync then doctor for an OS scheduler the user sets up and records the outcome in the machine-local runtime state; doctor shows the last run. Exit codes 0 ok, 4 needs attention, 1 the check failed, 3 another run holds the lock; 2 stays argparse's usage error. `--notify` (default off) shows a platform notification only when the result changes, plus a reminder every seven days while a problem lasts. The text names issue kinds and counts, never a note or a path. When it cannot be shown the line is said once at the next session start. Addresses the avenoxai#255 review: the run lock is an OS advisory lock (no stale lock to reclaim, nobody else's lock deleted), human mode no longer reads as a failed command, doctor passes only known fields of the record, and the docs cover macOS python 3.11+, Full Disk Access and logs instead of /dev/null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ind tests - PREFERENCES.md: the schtasks example now uses --% so Windows PowerShell 5.1 hands /TR to schtasks unchanged; without it 5.1 split the \" escapes and the vault path fell out of /TR. Linux systemd example notes Python 3.11+. - tests: issues() for task/validity counts and their read errors, hook-error.json, degraded sync, and decide() for an unreadable or future-dated last_notified_at. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The session-start line is the channel that always works: it is left whenever a run turns to needs attention (and at each weekly reminder), with or without --notify, since a notifier's exit 0 does not prove the notification was seen. A session says it once; a recovery takes back an unsaid line. - Windows toast text reaches Windows PowerShell 5.1 as single-quoted literals inside the encoded command (the hook-command pattern; 5.1 takes no arguments after -EncodedCommand), only printable ASCII passes; no environment hand-off, no shell. - Bookkeeping renamed to told_status / told_at: it tracks what the user was told by any channel. - Tests: secret-looking conflicted note name never reaches a text or a state file; quotes and subexpressions reach real powershell.exe literally; non-ASCII never reaches PowerShell; update + rollback keep doctor and SessionStart working; an already said problem is not announced again. - Docs: Script Editor name on macOS, "only when the user is logged on" on Windows, notify-send missing still leaves the session line, and where each platform was verified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #267.
beyin.py scheduled-check [--notify]: kullanıcının kendi kurduğu işletim sistemi zamanlayıcısı için öncesync, sonradoctor. Model çağırmaz, servis kurmaz, hiçbir şeyi onarmaz; Beyin zamanlayıcı kurmaz. #255'teki eleştiriler ve #267'deki inceleme listesi madde madde aşağıda.İnceleme listesine karşılık
scheduled-notice.jsonher zaman yazılır,--notifyolsun olmasın. İlk açılan oturum bir kez söyler; durum düzelirse söylenmemiş satır geri alınır. Bildirim ek kanal.ISSUE_LABELSkalıpları ve sayılardan kurulur. Test: adısk-ant-api03-parola-GIZLIolan çakışmış not (conflict, warning, skill, görev, geçerlilik hatası metinlerinde) ne bildirime, ne oturum satırına, ne kayda, nedoctorçıktısına, ne state klasöründeki herhangi bir dosyaya giriyor.on run argv. Windows: Windows PowerShell 5.1-EncodedCommand'dan sonra argüman kabul etmiyor (ölçüldü:Cannot process command because a command is already specified), bu yüzden hook komutlarındaki desen:param()bloğu, argümanlar kodlanmış komutun içinde tek tırnaklı literal ('→''). Yalnız yazdırılabilir ASCII geçer; tipografik tırnak gibi karakterler PowerShell'de tırnak sayıldığı için reddedilir ve bildirimfailedolur. Her alt süreçte zaman aşımı (sync/doctor900 sn, bildirim 30 sn).%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe.doctoryalnız okurscheduled-check.json,scheduled-check.lock,scheduled-notice.json, hepsi runtime state'te;.beyin-preferences.json'a anahtar eklenmez.doctoryalnız bilinen alanları bilinen türlerle geçirir, yazmaz. Notice'i söyleyince silen tek yer SessionStart (bir kez söyleme sözleşmesi bunu gerektiriyor).flock, Windowsmsvcrt), PID/yaş hesabı yok; ikinci koşu 3 ile çıkar._portalockdoğrudan kullanılmadı:install_v3.pyvault'a yalnızbeyin_v3*.pymodüllerini kopyalıyor, kurulu vault'taimport _portalockNo module named '_portalock'ile düştü (InstalledTest). Aynı ilkel,beyin_v3_compact._compact_lockvebeyin_v3_migrate._legacy_lockgibi satır içinde._portalock'u kurulum kümesine almayı tercih ederseniz ayrı bir değişiklik olarak yaparım.is_file().v3_perf_budget_testgeçiyor.notify-sendyoksa sessizce atlanır, satır yine çıkar. Hangi platformun nerede doğrulandığı tablo olarakPREFERENCES.md'de.Doğrulama
tests/v3_scheduled_check_test.py26 test: durum geçişleri (sağlıklı → dikkat → düzeldi), 7 günlük hatırlatma, aynı sorunda tekrar yok, gerçek ikinci süreçle kilit çakışması ve eski kilit dosyası üstünde 6 eşzamanlı koşu, sahte bildirim aracıyla argv denetimi, gerçekpowershell.exe'yea'b $(Write-Output PWNED); \whoami` "q"metninin aynen ulaşması, ASCII dışı metnin PowerShell'e hiç ulaşmaması, kurulum →update→rollbacksonrasıdoctor` ve SessionStart.--notifyile yazılması, düzelince geri alınmaması,shown'da silinmesi,''kaçışının kaldırılması, ASCII denetiminin kaldırılması, metnin betiğe gömülmesi, hatırlatmada satırın yazılmaması, satırın her gece yazılması.v3_*test.pypaketi 1355 test OK (skipped=35).notification: shown. Bildirim Bildirim Merkezi'ne düştü, ama kullanıcı tam ekran video izlerken açılır pencere olarak gelmedi; komut yine 0 döndü. Yani "gösterildi" bilgisi gerçekten güvenilmez, oturum satırını her zaman bırakma kararını doğruluyor. Ardından ilk SessionStart satırı söyledi, ikincisi söylemedi. macOS ve Linux yalnız testle doğrulandı.🤖 Generated with Claude Code