Repository navigation
fix: route daemon collection through operations owners - #5867
Merged
Merged
Conversation
Remove the conventional-index fallback after active-generation acquisition fails. Preserve the diagnostic and actual exception, with promoted-index and absent-tier regressions. Repair the deliberately damaged-column fixture by removing dependent triggers before dropping its column. Finding | Disposition | Evidence F756 | fixed by f823d48 and this correction | operations owns actual collection, workflow publication, membership, FTS acquisition and publication; all 15 adapter exemptions and eight obsolete degradation anchors are removed. The former fts_convergence direct import was fixed later by 14e1d82; its stale exemption was removed by 9d33b52. Focused verification remains pending on this corrected candidate.
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. |
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.
Summary
Move daemon metrics collection and convergence acquisition into their operations owners. Remove fifteen surface-to-substrate exemptions and eight retired SQLite degradation anchors.
Problem
Historical F756 on PR #4308 remains real for
daemon/convergence_stages.pyanddaemon/metrics.py: both acquired substrate state directly while their baseline exemptions made the ratchet accept it. The FTS convergence import was already corrected in #5027 and its stale exemption removed in #5531. The connected source membership route also fell back to a readable conventional shadow when the promoted index could not be acquired; workflow publication followed the promoted generation directory instead of the configured durable root.Solution
Operations owns metric acquisition, complete collector groups and exposition; the HTTP adapter publishes the product result. Workflow materialization and its ordered current receipt, source-to-session membership, and Sinex configured publication/barrier composition have substantive product owners. Existing FTS operations owns binding inspection and transactional publication. Every connected caller follows those owners, and unused predecessor helpers are deleted.
Required membership faults propagate; optional metric probe failures retain their typed evidence and existing diagnostic outcome. The ops-only corruption probe uses the canonical query-only diagnostic reader, preserves the schema-cookie check and closes its handle. Process collectors retain their lifecycle owners and the metric/HTTP contract is unchanged.
Verification
agentctl job start polylogue pytest_focused --workspace <candidate-worktree> --followed by this exact selection:Job 5242, head
cc9d913464231f24c0e46830733b1df358b7cee4, receipt20261001T022107Z-focused-test-3540546-6877456b:495 passed, 3 warnings; exit 0, 495 unique selected/terminal nodes, no retry.agentctl job start polylogue verify_quick --workspace <candidate-worktree>: job 5243, same head, receipt20261001T022113Z-quick-3540667-b9396fbd:verify: PASSED exit=0, all twelve gates pass.A fresh independent local review of exact head cc9d913 found no remaining scoped defect. Hosted Codex reviews are disabled by operator direction; no manual hosted request was made.
The selector covers 27 connected modules. No complete-corpus claim. Schema closure inspection found all eleven changed production files outside the derived identity closure; the final schema-closure gate also passes.
Self-review
Author reviewed the whole diff against base 81fff68, including transferred bodies, all connected callers and the retired inventories. Three correction passes; final pass after verification found no remaining scoped defect.
✓ Siblings and owners. The complete census covers both remaining F756 adapters, the source membership consumer in session-profile convergence, all three barrier consumers, the workflow receipt and existing FTS owner. All 15 adapter exemptions and eight predecessor anchors are removed.
✓ The fix itself. Reviewed the acquisition changes and the transferred functions against their original bodies. The final metrics AST census proves 48 function/class bodies unchanged and isolates seven typed refusal rewrites plus the canonical ops-only probe acquisition; their original fallback values and finally-close blocks remain. Hot-source capture is restricted to the original attachment failure branch.
✓ Memory and limits. No new limit, cache, timeout or archive enumeration is added. The existing scoped source/session join and collector buffers are retained. Existing sampling policies are unchanged.
✓ Cost per unit. The product retains its SQL parameters and indexed ordering. Membership now opens the active generation once instead of probing then reopening or falling back to a shadow. Source membership joins every selected path once. No per-row bootstrap or new archive-wide scan is introduced.
✓ Interruption. FTS publication retains BEGIN IMMEDIATE, rollback on refusal/exception, commit on certified binding and finally-close. Existing stage admission and derivation scheduling remain the cancellation/restart owners.
✓ Ordering and races. Workflow current receipts retain pass-start ordering and rejection of older failures. FTS binds within the existing admitted transaction. The configured root remains distinct from active index authority.
✓ Failure classification. Seven metrics readers and the hot-source attachment project existing Measured/Unavailable evidence with original event tokens and fallback behavior. Required source join and active-generation acquisition faults propagate; only a genuinely absent index remains empty. The existing index-probe diagnostic is retained before re-raising. Schema skew remains outside sqlite capture.
✓ Silent outcomes. No stage is retired without a replacement. FTS absence retains empty success, an invalid surface retains pending refusal, and collector failures retain availability evidence and process counters.
✓ Cleanup on failure. Transferred readers retain finally-close, including the ops-only schema-cookie probe now acquired through the canonical query-only diagnostic profile; FTS retains rollback and close. New authorizer-based fault regressions check that actual acquired metric connections close. Synthetic membership connections use explicit closing.
✓ Identity and keys. No durable DDL or ID partition changes. Workflow retains its stable current receipt key. The active generation still comes from ArchiveLocation; workflow materialization and ops receipt now keep the configured root.
✓ Lossless transforms. Metrics family names, labels, samples and process collectors are unchanged. The moved scalar SQL declaration names the same function and argument at its new owner. No public serialized schema changes.
✓ Degenerate inputs. Existing metrics coverage includes missing/malformed archives and measured/unmeasured groups. Source regression covers duplicate paths, an absent path, multiple matching sessions and a malformed required join. Empty stages retain their existing outcomes.
✓ Consumers. Repository search found and updated metrics imports, workflow direct tests, receipt callers and all barrier consumers. Unused archive writer and transient-lock wrappers are deleted, as is the sole-consumer active-index probe/fallback. Retired helper-name search has zero hits in the connected production/test/docs paths; the independent embedding orphan helper does not fall back after a failed read. The HTTP adapter retains only responder/content-type/handler responsibilities. The existing query-only reader census now covers all relocated owners.
✓ Tests and stubs. New regressions name restoring substrate imports or exemptions, following the promoted generation parent, swallowing a required join fault, losing typed metric diagnostics, or omitting finally-close as their failing mutations. The unchanged complete selector covers 27 connected modules. First candidate 5206 had 490 passes and one fixture setup failure; corrected 5234 had 492 passes and one real direct-open census failure, both reproduced by automatic diagnostic retry. Third candidate 5242 passed all 495 selected tests with three inherited lifecycle warnings; no diagnostic retry was needed. The damaged-column fixture removes its two dependent triggers before damaging the column, retaining all unavailable assertions.
✓ Trust boundaries. Only neutral synthetic database fixtures were added. No operator archive, transcript, original capture or private evidence enters Git. Diagnostic event policy is unchanged; metric payloads retain their existing bounded reason tokens.
✓ Assigned criteria. F756 implementation and regression are present; focused verification and twelve static gates pass on cc9d913; default-branch disposition remains pending independent local review, enforced checks and merge proof. Hosted Codex reviews were disabled by the operator. Neither the parent task nor the other nine F179 findings is claimed complete.
✓ Defect census. Search covers every old helper name, daemon metric import and configured barrier consumer. JSON baselines shrink only, with no replacements at the new operations paths.
✓ Complete interface changes. New owners replace the old definitions in the same batch. Direct workflow test consumers import operations, the three daemon composition sites import the new barrier owner, and HTTP still publishes the same response.
✓ Typed visible failures. capture_sqlite_read owns SQLite acquisition refusal; events retain original reasons. Required joins still raise, collector groups still expose availability, and unsuccessful FTS publication remains pending.
✓ Regression mutations. Restoring any adapter substrate import or exemption fails the gate regression. Returning the active generation parent fails workflow root/receipt assertions. Swallowing malformed joins, serving a stale conventional index after promoted acquisition failure, or retaining a metric reader fails the new production boundary tests.
✓ Public evidence. The patch contains code, current ownership docs and synthetic tests only. Scratch patch, AST census, selector and review remain outside Git under the task scratch directory.
Residuals
Inherited coroutine and writer-lifecycle warnings were handed to the active writer custody owner with their full immutable traces. This ownership change neither suppresses them nor claims their production fix. Historical task acceptance remains pending gated merge and default-branch proof; unrelated F179 findings are outside this batch.