Skip to content

fix: OPEN] - #4308

Merged
Sinity merged 2 commits into
masterfrom
feature/packet/polylogue-tas4
Aug 26, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/packet/polylogue-tas4

Conversation

@Sinity

@Sinity Sinity commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces FTS startup repair with one domain-owned derivation (polylogue-tas4): polylogue/storage/fts/derivation.py (+475) becomes the single owner, convergence_stages.py sheds its stage-based FTS path (−283), and daemon startup routes through FtsConvergenceOwner instead of the legacy readiness helper.

Review notes

  • Removed assertions belong to the retired stage-based convergence (test_convergence_stages.py); the replacement is covered by the new test_fts_derivation.py (+192).
  • Verified the routing claim rather than taking it: _run_startup_fts_readiness in daemon/cli.py calls FtsConvergenceOwner, so startup genuinely uses the new owner.

Verification

  • Focused FTS derivation and convergence suites green in-lane. Lane quick gate env-blocked (known class); gate rerun at harvest.

Residuals

  • daemon/fts_startup.py (492 lines) is retained: metrics.py still imports active_fts_triggers_sync from it, and daemon/cli.py keeps an explicitly-unused _ensure_fts_startup_readiness alias that legacy tests still exercise. Finishing that retirement is dispatched as a follow-up so the bead can close on one canonical route.

🤖 Generated with Claude Code

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA

@Sinity
Sinity enabled auto-merge (squash) August 26, 2026 23:15
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cf0e66fc-f8ca-4727-b4a6-844c3cf72277


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit 86b8c09 into master Aug 26, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the feature/packet/polylogue-tas4 branch August 26, 2026 23:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62c0a55bea

ℹ️ 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".

Comment thread polylogue/daemon/fts_convergence.py Resolved
Comment thread polylogue/daemon/fts_convergence.py Resolved
Comment thread polylogue/storage/fts/derivation.py Resolved
Comment thread polylogue/storage/fts/derivation.py Resolved
@Sinity

Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Codex review threads on this PR whose cited code is gone (checked against master at 23f91a5):

Resolving these threads.

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at ef10e59):

Resolving the fixed, stale and refuted threads; tracked threads stay open.

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at 64a9bd0):

  • P1 polylogue/daemon/fts_convergence.py:80: Stale: The session_work_events_fts surface and its source table were dropped from the index schema (polylogue/storage/fts/sql.py:214-216), so no work-event FTS debt surface remains. (checked at 64a9bd0)

Resolving every thread listed; confirmed defects are fixed under the named bead.

Sinity added a commit that referenced this pull request Oct 1, 2026
## 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.py` and `daemon/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.

| Finding | Disposition | Evidence |
| --- | --- | --- |
| F756 / CX56.F080, remaining stage and metric adapters | fixed |
cc9d913 plus f823d48 and 3845fb4; zero corresponding direct
imports or baseline exemptions; anti-vacuity regression covers restoring
either |
| F756, FTS convergence import | fixed-later | 14e1d82 (#5027); stale
exemption removed by 9d33b52 (#5531) |

## Verification

`agentctl job start polylogue pytest_focused --workspace
<candidate-worktree> --` followed by this exact selection:

```text
tests/integration/test_claude_workflow_admission.py
tests/unit/core/test_sqlite_lock_classification.py
tests/unit/daemon/test_convergence_debt_alert.py
tests/unit/daemon/test_convergence_final_state.py
tests/unit/daemon/test_convergence_restart_law.py
tests/unit/daemon/test_convergence_stages.py
tests/unit/daemon/test_daemon_cli.py
tests/unit/daemon/test_daemon_ops_lease_boundary.py
tests/unit/daemon/test_diagnostic_metrics.py
tests/unit/daemon/test_embedding_convergence_progress.py
tests/unit/daemon/test_fts_readiness_binding.py
tests/unit/daemon/test_hook_liveness.py
tests/unit/daemon/test_maintenance_read_profiles.py
tests/unit/daemon/test_metrics_endpoint.py
tests/unit/daemon/test_selected_session_parts.py
tests/unit/daemon/test_session_profile_composition.py
tests/unit/daemon/test_standing_queries_default_evaluator.py
tests/unit/daemon/test_unmeasured_observations.py
tests/unit/devtools/test_layering_gates.py
tests/unit/devtools/test_verify_rebuild_routes.py
tests/unit/insights/test_claude_workflow_evidence.py
tests/unit/operations/test_session_source_membership.py
tests/unit/sinex/test_convergence.py
tests/unit/sources/test_live_ingest_ops_work.py
tests/unit/storage/test_archive_readiness.py
tests/unit/storage/test_raw_observation_derivation.py
tests/unit/storage/test_write_lease.py
```

Job 5242, head `cc9d913464231f24c0e46830733b1df358b7cee4`, receipt
`20261001T022107Z-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, receipt
`20261001T022113Z-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.

1. ✓ **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.

2. ✓ **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.

3. ✓ **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.

4. ✓ **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.

5. ✓ **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.

6. ✓ **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.

7. ✓ **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.

8. ✓ **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.

9. ✓ **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.

10. ✓ **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.

11. ✓ **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.

12. ✓ **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.

13. ✓ **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.

14. ✓ **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.

15. ✓ **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.

16. ✓ **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.

17. ✓ **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.

18. ✓ **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.

19. ✓ **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.

20. ✓ **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.

21. ✓ **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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant