Repository navigation
fix(learning): make hook evidence delivery recoverable and observable - #153
Open
humandebri wants to merge 4 commits into
Open
humandebri wants to merge 4 commits into
humandebri wants to merge 4 commits into
Conversation
Hooks now only enqueue into the local outbox and start one detached `agent flush`, guarded by a per-scope pid lease. The flusher sends the backlog as atomic create-only write_nodes batches (<=100 nodes, ~1 MB) and falls back to per-event immutable verification when a batch fails, so conflicting remote content still fails without overwrite. Each hook answers its own request before best-effort replay of older spooled entries, removing the handled entry first, so a backlog or an unreplayable entry can no longer delay or block recall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…expose durable failure diagnostics
…lid replay bindings before they block delivery
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.
問題と変更後の動作
hookのinbox再送や証拠送信の待ち時間によって現在の文脈応答が失われること、送信障害が見えないこと、未送信の証拠で学習を開始できることを改善します。既存CLIとoutboxを拡張し、プラグインは引き続きCLIを利用します。
agent flush --replay-inboxを起動します。応答側は再送完了を待ちません。Unixでは配送子プロセスのプロセスグループを分離します。agent statusに保存時刻・配送試行/成功/失敗・固定エラーコード・inbox隔離情報を追加します。SQLiteは加算的に移行し、旧イベントの保存時刻は不明として扱います。生のstderrや証拠本文は診断情報に保存しません。常設Worker、独自スケジューラー、recallキャッシュは追加しません。配送失敗後は次回hookまたは手動flushで再送します。
検証
最新main (
6e9c7b4b) を既存ブランチにマージした後:cargo test --workspace --quiet: 944 passing test executions、0 failed、4 ignored(親テストが別プロセスで起動するfixtureを含む)cargo clippy -p kinic-vfs-cli --all-targets -- -D warningscargo fmt --all -- --check/git diff --check実装時の検証:Pythonアダプター50件、DSHプラグイン8件成功。ローカルcanisterと実CLI/Pythonアダプターで、遅延送信中の文脈応答、並行flushの排他、壊れたinboxの隔離、通信障害からの復旧、書き込み後の応答消失、親プロセスグループ終了後の配送継続を確認しました。入力公開の競合やlive入力の誤隔離についても回帰テストを追加しています。
詳細は
docs/HOOK_DELIVERY_VALIDATION.mdを参照してください。残る制限
mainnetへの読み取り専用測定では、identity読み込みからrecall終了まで30回すべて成功しましたが、30回すべて2秒を超過しました(初回5.869秒、中央値4.386秒、最大7.166秒)。debugバイナリ・固定タスクでの測定です。このPRは配送待ちを切り離しますが、Python hookの2秒制限内にrecallが収まることは保証しません。
Unixプロセスグループ終了試験は成功していますが、すべてのCodexアプリの子孫プロセス終了方式や非Unix環境を実証したものではありません。CLIが起動しない間の自動配送も保証しません。