Skip to content

fix(live): follow active index authority in every route - #3952

Merged
Sinity merged 65 commits into
masterfrom
feature/fix/suite-live-ingest-authority
Aug 14, 2026
Merged

Sinity merged 65 commits into
masterfrom
feature/fix/suite-live-ingest-authority

Conversation

@Sinity

@Sinity Sinity commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Make live ingest, replay, repair, and degraded acquisition follow the selected archive and active-index authority while preserving durable raw evidence when parsing or derived writes are unavailable.

Problem

Retained replay and source-only acquisition had authority gaps: weakly classified JSONL could be discarded or scanned without a total bound; oversized records could lose valid provider evidence based on key order; ZIP members could lose acquisition coordinates; cursors could outrun quarantine; repair could consult a stale index generation; and daemon/watcher startup or any exceptional shutdown step could permit source writes without rebuild exclusion.

Solution

  • Stream bounded structural provider evidence across oversized JSONL records under a hard 64 KiB total envelope; evidence outside the envelope remains UNKNOWN.
  • Preserve ZIP coordinates and detected-provider authority through acquisition, replay, corpus validation, and blob replacement.
  • Bind append envelopes before parsing, preserve retry identity, and hold cursor acknowledgement while quarantined.
  • Route replay, repair, FTS closure, and raw-authority receipts through the exact active index generation.
  • Acquire archive-writer rebuild exclusion before every public daemon and standalone-watch route.
  • Retain exclusion until process exit whenever coordinator drain times out, raises, is cancelled, or is skipped by an earlier cleanup or watcher-stop exception.
  • Preserve frozen Codex-state, payload-budget, timestamp-authority, and late nested-root semantics.

Verification

  • Production-route suite: 32 passed in 338.32s at parent 58a687b26 (20260814T023634Z-focused-test-1506517-c5e0bced). It includes the sanitized 804-revision acquisition → crash → resume → inactive-candidate proof; bounded late-discriminator and outside-budget cases; daemon/watch refusal, cancellation, cleanup failure, and undrained retention; ZIP coordinates; raw replay; corpus validation; frozen state; and watcher rediscovery.
  • Exact-head standalone-watch delta: 4 passed in 1.65s at 7412c09f9b8516c07a51ce8464e6de3c174a9642 (20260814T025306Z-focused-test-1682868-43880690). It reproduces a throwing watcher.stop() with an undrained coordinator and proves rebuild exclusion remains held.
  • Exact-head direnv exec . devtools verify --quick: all 25 gates passed in 159.45s (20260814T025335Z-quick-1689690-74c1c4e5).
  • Exact-head devtools workspace pr-scope check --pr 3952: pr-scope OK @ 7412c09f.
  • Anti-vacuity: regressions execute production daemon, watcher, acquisition, replay, repair, cursor, generation-selection, corpus-validation, and candidate-build routes. Removing the repaired bindings permits a rebuild concurrently, mutates the archive after refusal, loses provider/raw evidence, advances authority incorrectly, or reads a stale generation.

Review disposition

All earlier inline findings were repaired before their threads were resolved. The final three independent P1 findings—cleanup failure releasing exclusion, key-order-sensitive oversized JSONL detection, and standalone watcher-stop failure skipping drain—are reproduced and repaired. CI and final exact-head review are not represented as complete until returned.

Risks and follow-ups

This changes live-ingest authority but does not mutate the production archive. Authenticated archive-root recovery, source migration, inactive-candidate construction, and the terminal current-master full-suite/testmon receipt remain separate operations.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change routes archive operations through active-index generations, adds source-only live acquisition, classifies artifacts and decoded evidence, improves hook-spool retries, and updates retention, repair, and validation behavior.

Changes

Active index, live acquisition, and evidence handling

Layer / File(s) Summary
Active index routing and archive bootstrap
polylogue/config.py, polylogue/storage/..., polylogue/daemon/..., polylogue/browser_capture/...
Archive operations resolve the active index path. Explicit index overrides remain supported. Bootstrap calls are serialized.
Live acquisition and artifact admission
polylogue/sources/live/*, polylogue/sources/hooks.py, polylogue/archive/artifact_taxonomy/*, polylogue/sources/source_parsing.py
Source-only mode acquires source-tier data without a derived index. JSONL/NDJSON detection and artifact classification control session admission.
Watcher ownership and hook-spool retries
polylogue/sources/live/watcher.py, tests/unit/sources/test_hook_spool.py, tests/unit/sources/test_live_watcher*.py
The watcher resolves the deepest source owner, accepts relevant directories, drains existing files, retries hook shards, and cancels retry tasks.
Retention, repair, and validation lifecycle
polylogue/storage/raw_retention.py, polylogue/storage/repair.py, polylogue/storage/raw_authority.py, polylogue/storage/raw_reconciler.py, polylogue/schemas/sampling_db.py, polylogue/daemon/*
Terminal evidence receives scoped retention authority. Repair and replay propagate the active index path and writer leases. Parsed rows with historical validation failures remain eligible where applicable.

Estimated code review effort: 5 (Critical) | ~120 minutes

Mergeability Score: 🟠 High · up to da300

The change affects retained-source replay, archive routing, raw cleanup, ZIP identity, and repair batching. Unresolved paths can write to the wrong archive, merge distinct source coordinates, bypass safety handling, or commit partial repair state, so the PR is not merge-ready until these correctness and availability risks are fixed or explicitly accepted.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.20% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: routing live-ingest behavior through active-index authority.
Description check ✅ Passed The description covers the main template sections and provides detailed verification, risks, and a self-contained scope attestation.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/suite-live-ingest-authority

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.

@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: 79ee92aeec

ℹ️ 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/sources/live/batch.py Resolved
Comment thread polylogue/sources/live/watcher.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 45bcb3ad1bd8cf92859ced7409b10191a6c41f53, including the two repaired live delivery routes and their regressions.

@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: 45bcb3ad1b

ℹ️ 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/storage/raw_retention.py Resolved
Comment thread polylogue/storage/raw_retention.py Resolved
Comment thread polylogue/storage/repair.py Resolved
Comment thread polylogue/sources/live/batch.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head aa9624f45259714e5b532f7763a53f25a298fc1b, including the bounded re-drain for the added hook-shard atomic-publication race.

@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: aa9624f452

ℹ️ 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/sources/live/watcher.py Resolved
Comment thread polylogue/storage/raw_retention.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex Please review the final exact head dc568e3. Focus on the Provider.UNKNOWN strict-classification route and the added hook-spool day-shard retry lifecycle; the latter must tolerate a first envelope published after the former fixed grace period without relying on periodic catch-up.

@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: dc568e344c

ℹ️ 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/sources/live/watcher.py Resolved
Comment thread polylogue/sources/live/batch.py Resolved

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@polylogue/sources/live/watcher.py`:
- Around line 430-463: Bound _retry_hook_spool_directory_until_populated with a
short deadline using a new _HOOK_SPOOL_DIRECTORY_RETRY_MAX_S constant defined
alongside _HOOK_SPOOL_DIRECTORY_RETRY_POLL_S. Stop polling once the deadline
expires, while preserving the existing shutdown, directory-removal, OSError, and
JSON-detected behaviors.

In `@polylogue/storage/raw_retention.py`:
- Around line 1409-1410: Update the logic around the semantic-only check so an
active semantic head is first validated for a corresponding source-tier row in
raw_sessions; raise the broken-head violation when that row is absent. Preserve
the existing byte-chain exemption, but do not let seed_raw_id in
semantic_only_raw_ids bypass the row is None validation or cursor handling.
- Around line 1678-1684: Update _terminal_artifact_raw_ids() to query ordered
terminal_paths in batches of 500, matching _terminal_artifact_paths(), and
aggregate raw_id results across all batches into the returned frozenset.
Preserve the existing empty-input behavior and query semantics while preventing
SQLite bind-variable-limit errors that bypass RawRetentionSafetyError handling.

In `@tests/unit/sources/test_hook_spool.py`:
- Around line 311-365: Mark
test_live_watcher_retries_added_hook_shard_until_atomic_publish with
pytest.mark.uses_real_clock, providing a reason that it relies on real asyncio
timing for the 0.10-second publish delay and 0.01-second polling against the
production retry interval.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8e2f986d-2825-4ea2-96ed-f6dfc62b0bb1

📥 Commits

Reviewing files that changed from the base of the PR and between c27af7d and dc568e3.

📒 Files selected for processing (12)
  • polylogue/sources/live/append_ingest.py
  • polylogue/sources/live/batch.py
  • polylogue/sources/live/watcher.py
  • polylogue/storage/raw_retention.py
  • polylogue/storage/repair.py
  • polylogue/storage/sqlite/archive_tiers/archive.py
  • polylogue/storage/sqlite/archive_tiers/bootstrap.py
  • tests/unit/sources/test_hook_spool.py
  • tests/unit/sources/test_live_watcher.py
  • tests/unit/sources/test_live_watcher_locking.py
  • tests/unit/storage/test_raw_retention.py
  • tests/unit/storage/test_repair.py

Comment thread polylogue/sources/live/watcher.py Resolved
Comment thread polylogue/storage/raw_retention.py Resolved
Comment thread polylogue/storage/raw_retention.py Resolved
Comment thread tests/unit/sources/test_hook_spool.py Resolved
@Sinity
Sinity force-pushed the feature/fix/suite-live-ingest-authority branch from dc568e3 to 6a2bed2 Compare August 12, 2026 21:58
@Sinity

Sinity commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 6a2bed2bb28642acceccb3e97cd2dceb3ed78e79. Focus on the post-rebase synthetic fixture alignment: full archive bootstrap, fail-closed cursor authority, persisted census gating, and terminal raw-replay outcomes.

@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: 6a2bed2bb2

ℹ️ 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/sources/live/batch.py Resolved
@Sinity

Sinity commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 01327dee69328b2ee0b907169f4a815a50b513bf. The P1 unknown weak-path JSON admission repair and its real-route regression are included in this head.

@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: 01327dee69

ℹ️ 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/storage/raw_retention.py Resolved
@Sinity

Sinity commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@Sinity

Sinity commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review this exact pushed head only: 17435a4. The complete seven-file affected suite passed (446 tests), the three reproduced lifecycle regressions passed, and all 25 quick checks passed.

@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: 17435a4e5e

ℹ️ 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/sources/live/batch_support.py Resolved
Sinity added a commit that referenced this pull request Aug 12, 2026
Problem: large non-JSONL sidecars could reach generic streaming admission before definitive path classification.\n\nWhat changed: expose the existing strong path rules for live admission, preserve weak analysis-path payload and streaming handling, and cover both the full-ingest and preloaded-payload routes.\n\nCompatibility: the public path classifier preserves its output; the fingerprint manifest records the safe internal delegation.\n\nRef #3952
@Sinity

Sinity commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact pushed head 694ca99ee46cc72184399d86fac86c3cd1b00567 only. Strong non-session path rules now precede non-JSONL large-file streaming; weak analysis/ paths retain bounded payload or streaming handling. Verification: focused regression passed, the 118-test live-batch support file passed, and all 25 quick stages passed.

@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: 694ca99ee4

ℹ️ 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/sources/live/batch.py Resolved
Comment thread polylogue/storage/raw_retention.py Resolved
Comment thread polylogue/sources/live/watcher.py Resolved
Sinity added a commit that referenced this pull request Aug 12, 2026
Problem: large non-JSONL sidecars could reach generic streaming admission before definitive path classification.\n\nWhat changed: expose the existing strong path rules for live admission, preserve weak analysis-path payload and streaming handling, and cover both the full-ingest and preloaded-payload routes.\n\nCompatibility: the public path classifier preserves its output; the fingerprint manifest records the safe internal delegation.\n\nRef #3952
@Sinity
Sinity force-pushed the feature/fix/suite-live-ingest-authority branch from 694ca99 to 62a276a Compare August 12, 2026 23:58
@Sinity

Sinity commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact rebased head 62a276a3fb399f52d1616495b1e41329b0d5dafc only. The seven-file production-route suite passed 447 tests and all 25 quick checks passed after rebasing onto current master.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 62a276a3fb

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

@Sinity

Sinity commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 019f7c88e653dcb01445566714d127bfc3c8f716, including the three latest authority and containment repairs.

@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: 019f7c88e6

ℹ️ 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/storage/raw_retention.py Resolved
@Sinity

Sinity commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 4ffd2d8, especially terminal-artifact authority after successful reparse.

@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: 4ffd2d876e

ℹ️ 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/storage/raw_retention.py Resolved
@Sinity

Sinity commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 33cf85b, especially the validation-before-materialization ordering and stale terminal-carrier revocation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 33cf85b88c

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

@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review exact head 118005d. Please review the combined final head, especially active-index authority, bounded retained replay, provider/ZIP identity, lease refusal, frozen Codex state, and watcher catch-up.

@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: 118005dbe1

ℹ️ 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/sources/revision_backfill.py Resolved
Comment thread polylogue/daemon/cli.py Resolved
@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact pushed head ec151aab942ea2f3ee16538c9a14635ac7b690c0. The repair preserves positive provider evidence beyond the total scan cap and keeps interrupted-frontier recovery, stale-plan resolution, repair, FTS closure, and raw-authority convergence under one generation lease; lease refusal must mutate none of them.

@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact pushed head 76533937a9890bcbe8e42c502679c6ef43a10aef. The latest repair moves direct blob-reference restoration behind the same generation lease and makes refusal prove that restoration, recovery, stale-plan resolution, repair, FTS closure, and frontier convergence all remain untouched.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 76533937a9

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

@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact pushed head 4984774bcc3df941c79578d4ac6f0122e02e7663. The daemon now acquires archive-writer rebuild exclusion for its complete lifetime before every source/index startup or periodic mutation; raw-materialization retains its nested exact-generation lease and fail-closed typed refusal.

@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: 4984774bcc

ℹ️ 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/cli.py Resolved
Comment thread polylogue/daemon/cli.py Resolved
@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact pushed head 7e58dd94e0c5dae005ad6777ba9e3845af239464. Both public daemon and standalone watch now acquire rebuild exclusion before archive entry; drain timeouts retain the lease until process exit, and refusal compares the complete archive byte graph before/after.

@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: 7e58dd94e0

ℹ️ 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/cli.py Resolved
Comment thread polylogue/daemon/cli.py Resolved
@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review exact head 8dbb635, including cancellation during coordinator drain.

@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: 8dbb6352ec

ℹ️ 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/cli.py Resolved
Sinity added 2 commits August 14, 2026 04:14
Problem: Provider detection stopped at the first 8192 bytes of an oversized JSONL record, so a valid discriminator after a large preceding field was treated as UNKNOWN.

What changed: Stream each retained JSONL record through the existing scalar-bounded structural probe in 4096-byte chunks, sharing the hard 64 KiB total scan envelope. Add a Codex late-session_meta regression and malformed huge-input budget coverage.

Alternatives rejected: Eager whole-record parsing and unbounded scanning would violate the retained-replay resource contract.

Compatibility: Positive evidence remains routed through the existing provider detectors. Evidence outside the envelope remains UNKNOWN.
@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review exact head 58a687b. The final two P1 reproductions are now in the exact-head 32-test production-route suite.

@Sinity

Sinity commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review exact head 7412c09. The standalone watcher-stop P1 now has an exact production-route regression.

@Sinity
Sinity merged commit 190f651 into master Aug 14, 2026
3 checks passed
@Sinity
Sinity deleted the feature/fix/suite-live-ingest-authority branch August 14, 2026 03:05

@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: 7412c09f9b

ℹ️ 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/cli.py Resolved
Comment thread polylogue/config.py Resolved
Sinity added a commit that referenced this pull request Aug 14, 2026
## Summary

Remove self-attesting campaign machinery while retaining executable
product behavior, durable authority, operational safety, and
independently valuable verification.

## Problem

The repository had accumulated generated mirrors, passive ledgers,
campaign packets, duplicate tracker projections, source-text scans,
one-shot reports, and tests that proved only their declarations. They
increased maintenance cost and made process artifacts look like runtime
authority. Review of the purge also exposed real defects in destructive
deletion, raw-authority proof binding, canary authority, benchmark
reporting, and continuity replay isolation.

## Solution

- Delete 324 retired files and roughly 79,000 lines of generated
reports, campaign wrappers, tracker/dashboard mirrors, prose-pattern
gates, stale planning packets, and duplicate authority registries.
- Retain runtime-consumed registries and executable evidence:
operation/action/query descriptors, origin specifications, SLO
benchmarks, durable migrations and audit records, parser fingerprints,
continuity replay, schema/layering checks, and behavior-level tests.
- Preserve one daemon-owned destructive-delete path with exact preview,
authorization, acknowledgement, cancellation, and batch binding.
- Bind raw-authority exceptions to the complete exact set of planted
terminal/deferred outcomes and seeded component/raw IDs; reject missing,
swapped, duplicate, unrelated, or falsely successful receipts.
- Keep canary semantic authority package-local and exact: a delta must
declare the reviewed operation, columns, table, and targeted
session/origin scope. Constraint-only, unscoped, unrelated, tracker, or
successor metadata cannot authorize candidate differences.
- Require continuity replay to name an exact catalog and run in a
completely hermetic environment: no inherited cwd/site config, daemon
URL/token, MCP capability, HOME/XDG, temp, or user-data authority.
Explicit offline mode suppresses per-call delivery and startup outbox
draining. A supplied archive is proven byte-identical before/after and
cannot emit an outbound daemon request.
- Replace the cancellation swarm/timing race with one deterministic
production-route proof per interruptible MCP tool. A disposable server
holds its real admission slot, one official MCP request queues, one
cancellation is confirmed, and a protocol ping proves healthy ordered
teardown. Equivalent scenarios reuse that tool-level proof.
- Keep structured Beads graph-cycle failure reporting, canonical canary
row identities, real benchmark metrics, and behavior-derived
command/document coverage.
- Retire the closed claim-vs-evidence campaign’s
private-report/calibration/publishing harness; reusable query semantics
remain on ordinary production routes.

## Verification

- Affected reindex-canary, daemon coordination, continuity, MCP
telemetry, CLI, and Beads graph suite: `167 passed in 154.70s`.
- Deterministic MCP cancellation regression: three fresh-process passes;
deduplicated run `1 passed in 18.92s` (previous redundant path was
roughly 26–30 seconds).
- Hermetic supplied-archive proof: zero outbound requests, unchanged
tier SHA-256 digests, and no archive-local runtime state.
- Focused deletion/raw-authority suites from the branch: 14 and 22
passed.
- Semantic schema wiring: 30 passed.
- Action/completion/workflow behavior: 192 passed.
- Documentation discovery/render coverage: 7 passed; `devtools render
all --check` passed.
- Exact-head review-repair suite: 98 focused tests covering canary
authority, raw-authority restart proof, hermetic continuity replay, MCP
telemetry, and server runtime.
- Exact post-rebase quick gate: all 10 checks passed in 59.29s
(`20260814T031542Z-quick-1912950-306d6f9e`).
- Final P1 repair restored the published source migration bytes exactly;
two durable-train hash/replay tests passed, followed by the 25.4s
exact-head quick gate (`20260814T033106Z-quick-2033174-5bd70dec`).

## Scope disposition

This is self-contained repository cleanup and correctness repair. It
assigns or mutates no Beads. #3952 merged first; this branch is now
rebased onto that exact master, with the 98-test production-route suite
and quick gate run at parent `e49a320d`, then the published-migration
repair verified at final head `13135b37`. The merge train still requires
its terminal complete-suite/testmon receipt.

<!-- polylogue-pr-scope:v2
{
  "assigned_beads": [],
  "dispositions": [],
  "mutated_beads": [],
"scope_digest":
"79a7984a9ec80a157c96dc8d28561159c642c15de3793837eff751fa7eac34a1",
  "scope_kind": "self_contained",
  "version": 2
}
-->
Sinity added a commit that referenced this pull request Oct 1, 2026
## Summary

Make default runtime Config projections follow the selected archive
root’s promoted index generation. Preserve explicitly supplied database
paths and defensive settings/source projection.

## Problem

ResolvedRuntimeConfig.as_config passed its already-resolved default
index path as Config(db_path=...). That marks the path explicit, so
after generation A promotes to B, current_db_path still returns A. The
production materialization_generation_lease and raw frontier attachment
consume that path. Historical evidence: PR #3952 thread
PRRT_kwDOR7_N4c6ZJigM,
#3952 (comment).

## Solution

Use the existing Config constructor default during runtime projection.
No new flag or parallel path. Add production generation-lease tests
reading distinct SQLite A/B contents, source-clone and explicit-pin
controls, and selected-root/settings/source projection checks. Document
the behavior. Correct an inherited test to assert the typed ConfigError
refusal rather than diagnostic wording.

## Verification

- devtools test tests/unit/core/test_config.py
tests/unit/core/test_config_resolution_regression.py
tests/unit/product/test_raw_authority.py: job5576, 115 passed, exit0,
exact clean head803f96affc14970a64eb1b0d02830207831707c8.
- devtools verify --quick: job5577, Success, exit0 on the same head.
- Normal precommit format/lint hooks passed. git diff f9bdf41...HEAD
--check passed.
- Initial focused job5571 is void because the checkout moved after
launch; it exposed the inherited wording assertion subsequently
corrected. It supplies no passing evidence.

## Self-review

Author review of f9bdf41...803f96a.
Two whole-diff passes; final pass clean. Current repository guide
contains 15 numbered items; generic worker-contract contains six. All 21
considered below.

✓ 1 Siblings and owners: Config owns implicit/explicit choice. Searched
all current_db_path callers (two), with_sources, active_archive_root,
archive_file_set_root, runtime projection and runtime resolver. Only
as_config manufactured an explicit path; omission reuses existing
constructor semantics.
✓ 2 Fix itself: no new state, flag or exception. Constructor already
resolves an explicitly supplied root. Projection still copies sources
and carries settings.
N/A 3 Memory and limits: no input loop/cache/cap added; two tiny
synthetic SQLite witness rows exercise behavior.
✓ 4 Cost per unit: existing single pointer resolution per projection and
per current_db_path call; no archive scan added.
N/A 5 Interruption: no product lifecycle/write transition added. Test
leases retain existing context cleanup.
✓ 6 Ordering and races: materialization_generation_lease acquires shared
generation exclusion before current_db_path; regression checks exclusive
RebuildLease refusal during reads.
✓ 7 Failure classification: existing typed pointer errors propagate
through constructor; no catch/fallback added.
N/A 8 Silent outcomes: no enumeration/status decision changed. Tests
assert actual A/B rows rather than a success flag.
✓ 9 Cleanup on failure: test connections and generation leases use
context managers; production cleanup unchanged.
N/A 10 Identity and keys: no semantic hashes, durable IDs or receipt
keys changed. Derived-closure membership is pending recorded job5574;
passing static gate is not a membership claim.
✓ 11 Lossless transforms: core regression checks archive/render roots,
sources, Drive/index projections, embedding settings and interval;
clearing projected sources leaves runtime tuple intact.
✓ 12 Degenerate inputs: existing constructor/default-path tests
retained; core regression covers no initial index, production tests
cover empty manual source list and both pin choices.
✓ 13 Consumers: two current_db_path consumers need no interface changes.
with_sources already preserves implicit/explicit choice. Documentation
states promotion and manual pin contract.
✓ 14 Tests and stubs: actual runtime resolver and actual
generation-lease consumer read distinct SQLite A/B values. Reintroducing
db_path=self.paths.index_db makes implicit branch read A. Discarding
explicit path makes control read B. Ambient-root mutation and source
clone exercise same production semantics without monkeypatched product
functions.
✓ 15 Trust boundaries: only neutral synthetic witness values and
tmp_path roots; no private archives/credentials. Changed config
precommit scan spans pre-existing assignments, no new credential field
or content.

✓ Generic 1 Criterion coverage: tests cover generation, pin, projection
on production path. Focused5576 and quick5577 passed on the clean exact
head. Delivery remains open until protected merge.
✓ Generic 2 Defect-class coverage: rg current_db_path yielded exactly
two consumers; as_config one producer; with_sources one clone.
Constructor manually explicit control retained.
✓ Generic 3 Consumers and predecessor: no interface removed; defective
explicit argument deleted, existing implicit route becomes the sole
default projection. Documentation updated.
✓ Generic 4 Typed visible failures: no new exception handling, statuses
or fallback; existing ArchiveLocationError boundary unchanged.
✓ Generic 5 Anti-vacuity: restoring projection's explicit argument turns
promoted implicit A/B assertion red; ignoring explicit pin turns
explicit control red; removing list copy makes clear mutate source
authority.
✓ Generic 6 Privacy: four-file public diff carries no operator data or
private results; all evidence packets remain private scratch.

Inherited focused failure was corrected in the same test file: flat
daemon keys must raise ConfigError, and prose wording is not its
declared contract. Sibling search found exactly one daemon wording
matcher. No findings in final pass. Broad suites were not requested;
selected checks prove their declared scope only.

## Residuals

Focused tests prove runtime resolution, source cloning, and production
lease reads on Linux. They replace the pointer text directly and do not
exercise the full IndexGenerationStore.promote lifecycle. No broad suite
or live operator archive was run. Publication and merge remain subject
to protected required statuses. The separate Darwin audit-leaf proof
hold is outside this change and remains unverified.
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5af38ee. This records that source revision; it does not claim a fresh review of current master.

  • 80.F009 / P1: fixed-already at the checked revision: Original source inspection at f9bdf41: revision_backfill.py:681 returns positive detection before record.drain() at :683. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.
  • 80.F010 / P1: stale at the checked revision: Original source inspection at f9bdf41: daemon/cli.py no longer calls recover_interrupted_frontier; run_daemon_services:1999 acquires archive_writer_rebuild_exclusion before service composition. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.
  • 80.F011 / P1: stale at the checked revision: Original source inspection at f9bdf41: rebuild_index_from_source_sync and prior HTTP /api/maintenance/rebuild-index route absent from polylogue tree; daemon cold-build uses candidate generation pipeline. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.
  • 80.F012 / P1: fixed-already at the checked revision: Original source inspection at f9bdf41: index_generation.py:_open_lock_fd keeps kernel lock authoritative and raises on BlockingIOError; never replaces dead-owner locked inode. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.
  • 80.F013 / P1: fixed-already at the checked revision: Original source inspection at f9bdf41: daemon/cli.py:1893 catches BaseException around coordinator.shutdown and retains exclusion. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.
  • 80.F014 / P1: fixed-already at the checked revision: Original source inspection at f9bdf41: daemon/cli.py:3571 outer finally retains rebuild exclusion for unproven drain on all cleanup exits. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.
  • 80.F015 / P1: stale at the checked revision: Original source inspection at f9bdf41: LiveWatcher.run:517 only watch_changes, no _enqueue/_debounced_batch/_drain_task production route; finally cancels/awaits watch_task. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.
  • 80.F016 / P1: fixed-already at the checked revision: Original live claim at f9bdf41 is now fixed by PR fix: follow promoted generations in runtime Config projections #5872, merge 5af38ee, owned by closed polylogue-4znoj. ResolvedRuntimeConfig.as_config uses the existing constructor default at polylogue/config.py:1882. Dynamic default generation resolution, manual explicit pinning and source clones passed production lease/read tests; the merge tree equals the tested tree.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5af38ee. This records that source revision; it does not claim a fresh review of current master.

  • 81.F004 / P2: stale at the checked revision: Original source inspection at f9bdf41: LiveWatcher.run:517 only owns watch_task and finally cancels/awaits it :536; _drain_task/_debounced_batch no longer exist. Relevant source blobs or path absence are mechanically unchanged at 5af38ee; no new semantic review is claimed.

Only the rows listed above are dispositioned. Held findings remain open.

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