Repository navigation
perf(daemon): drain convergence and retention backlogs by work - #5692
Conversation
The writer now refuses unknown statuses, so the reader's refusal test wrote nothing and failed on the writer's ValueError instead. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3bfb3a8e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review findings on the backlog drains: - an archive-wide stage clear keeps rows recorded in the millisecond its run started (strict cutoff); - a deferred-debt release whose write never ran raises instead of reporting zero rows released; - deferred debt is released when a cold build settles, promoted or discarded; - raw-retention passes page 64 backlog paths per writer admission, so one pass cannot hold the writer across thousands of snapshots; - the source-family cache keys on every POLYLOGUE_*, XDG_* and HOME value; - the daemon reads the cold-build registry through its intake seam, not from polylogue.sources (layering ratchet). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d1736c761
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A stage settled by one archive-wide clear no longer also clears its rows per subject (which ignored the run-start cutoff and deleted rows re-recorded after the run began). A clear that could not be written is reported as degraded and leaves the rows for the next pass. The source-family cache key includes the selected config files' revisions. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…ent routes The periodic retry drains through _drain_convergence_debt_backlog (#5692), so patching the single-page helper let the real drain run. Status is served by the daemon (#5550); with none running it reports unavailable rather than materialization counts, which the find/analyze/readiness surfaces still compute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…ent routes The periodic retry drains through _drain_convergence_debt_backlog (#5692), so patching the single-page helper let the real drain run. Status is served by the daemon (#5550); with none running it reports unavailable rather than materialization counts, which the find/analyze/readiness surfaces still compute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Summary
Convergence-debt and raw-retention backlogs now drain by work, not by tick. A subject-independent stage runs once per backlog instead of once per row. Debt left by a cold build waits for promotion and is then released immediately.
Problem (evidence)
Numbers come from
devtools bench fresh-build(#5678). Each run cold-builds a sealed 144-file (276 MiB) private sample of Claude Code, Codex and Gemini sources throughpolylogued run --cold-build-indexon a shared host (load 18-35). Only aggregate numbers are quoted. Wall times move with host load; writer holds, stage timers and CPU seconds move less.After intake finished, derived convergence never became terminal on master. The generic drain retried at most 100 debt rows per 60 s tick, and raw retention retried 25 rows per pass. Stages whose verdict ignores the subject (
delegation_work_evidence,raw_authority_verdict_cache,fts_readiness_binding) ran once for every one of the 1,008 debt rows. The drain also ran during the cold build against the empty active generation, pushing rows into backoff before promotion.Solution
_drain_convergence_debt_backlogloops pages within a 45 s budget. Rows owned by other loops are excluded from the page query.ConvergenceStage.subject_independent: the drain runs one representative, and on success clears the stage's rows recorded up to that point.raw_authority_verdict_cacheloops its batches while they make progress (10 s pass). Raw-retention retry loops until the backlog stops shrinking (30 s budget, 64 backlog paths per writer admission).settle_cold_buildreleases deferred debt backoff after promotion.test_convergence_debt_summary_rejects_unknown_statuswrote its corrupt row through the writer, which now validates statuses, so the test corrupts the row withUPDATEinstead.Verification
devtools test tests/unit/daemon/test_convergence_debt_drain.py tests/unit/daemon/test_convergence_debt.py tests/unit/daemon/test_convergence_stages.py tests/unit/daemon/test_convergence_debt_alert.pyplus threetest_live_batch_support.pyraw-retention ids: all passed except the inherited status test. After the fix, that test's rerun passed.Residuals
session_profile,session_usage_rollup) still publish in bursts of about 64 per pass. They now dominate the time from promotion to terminal.🤖 Generated with Claude Code
https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4