Skip to content

fix(devtools): shard resumable testmon seeding - #3956

Merged
Sinity merged 14 commits into
masterfrom
feature/fix/testmon-sharded-seed
Aug 12, 2026
Merged

Sinity merged 14 commits into
masterfrom
feature/fix/testmon-sharded-seed

Conversation

@Sinity

@Sinity Sinity commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Make the pytest-testmon seed resumable and bounded by deterministic serial shards.

Problem

The previous seed ran 21,079 non-integration tests in one xdist invocation, timed out after 45 minutes, and produced no eligible seed. Raising the timeout or weakening release checks would hide failures and preserve an unusable harness.

Solution

Collect the complete correctness-test node set before testmon writes, partition it into deterministic 256-node shards, run one shard at a time with one SQLite writer, checkpoint shard/node outcomes, resume unfinished shards, and require a terminal complete failure-free graph before publishing seed.json. Protocol version 7 invalidates old incomplete receipts. Benchmark campaigns remain explicit and are excluded from the correctness/testmon seed.

Verification

  • devtools test tests/unit/devtools/test_verify.py tests/unit/devtools/test_testmon_state.py tests/unit/devtools/test_checkout_guard.py — 185 passed before the marker correction; 185 passed after it
  • devtools verify --quick — all 25 steps passed
  • End-to-end seed run is in progress at exact head a50b4b548; no release seed is claimed yet.

This is a self-contained test-harness correction; no Beads state was changed.

Summary by CodeRabbit

  • Improvements

    • Archive search indexes now record freshness after background processing, improving visibility into whether search results are up to date.
    • Archive convergence more reliably publishes and tracks raw sessions, attachments, and parsed data.
    • Cold-reopen and delegated-session processing are more resilient across recovery and replay workflows.
  • Bug Fixes

    • Improved test and subprocess isolation to prevent verification state from overwriting parent results.
    • Corrected lifecycle reporting for setup, execution, and teardown phases.

Problem: the 21k-node seed wrote to one testmon database through xdist workers and hit the bounded pytest timeout before it could publish a complete baseline.

What changed: collect the full selected node set first, partition it deterministically, and execute each shard serially with one testmon writer. Persist shard-level node outcomes after every shard and resume only unfinished shards. Release publication now requires a terminal shard ledger as well as complete, failure-free graph coverage.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7dd09545-9672-4b95-874f-b59a2c463576

📥 Commits

Reviewing files that changed from the base of the PR and between 1203919 and 31e0836.

📒 Files selected for processing (4)
  • polylogue/daemon/fts_startup.py
  • tests/conftest.py
  • tests/infra/convergence_harness.py
  • tests/unit/devtools/test_pytest_progress_plugin.py
📝 Walkthrough

Walkthrough

Changes

Testmon verification

Layer / File(s) Summary
Pytest report and environment handling
tests/conftest.py, tests/unit/test_pytest_temp_policy.py, tests/unit/devtools/test_pytest_progress_plugin.py
Pytest report handling uses hookwrapper=True. Managed verification variables survive environment cleanup. Subprocess and phase-report tests cover the updated behavior.
Testmon seed filtering and capacity
devtools/checkout_guard.py, devtools/verify.py, tests/unit/devtools/test_verify.py
The seed protocol advances to version 7. Benchmark tests are excluded, seed runs allow up to 10 workers, and verification expectations reflect the updated commands.

FTS freshness convergence

Layer / File(s) Summary
FTS freshness stage
polylogue/daemon/convergence_stages.py
A default convergence stage records archive-wide FTS freshness after insight processing and supports path, batch, and session execution.
Publication-aware convergence harness
tests/infra/convergence_harness.py
The harness publishes raw sessions and attachments through blob storage, consumes publication receipts, records source metadata, supports empty FTS fixtures, and validates supported archive surfaces.

Annotation fixture corrections

Layer / File(s) Summary
Data-driven annotation fixtures
tests/unit/annotations/test_durable_storage.py, tests/unit/annotations/test_importer.py
Annotation tests reopen archives in writable mode and derive delegation evidence references from archived actions.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ConvergencePipeline
  participant InsightMaterialization
  participant FTSFreshnessStage
  ConvergencePipeline->>InsightMaterialization: materialize insights
  ConvergencePipeline->>FTSFreshnessStage: execute fts_freshness stage
  FTSFreshnessStage->>ConvergencePipeline: record archive-wide freshness snapshot
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% 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
Title check ✅ Passed The title clearly describes the main change: making devtools Testmon seeding resumable through sharding.
Description check ✅ Passed The description covers the summary, problem, solution, verification, and self-contained scope with relevant technical details.
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.
✨ 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/testmon-sharded-seed

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 commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 136c2ef18 for testmon correctness. Focus on shard completeness, SQLite writer safety, resume behavior after timeout/partial node outcomes, and whether any path can publish a green seed without every expected node actually passing.

@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

polylogue/devtools/verify.py

Lines 2809 to 2812 in 136c2ef

elif use_database_fallback and recorded.get(nodeid) == "passed":
outcome, reason = "passed", "testmon database recorded success"
elif use_database_fallback and recorded.get(nodeid) == "failed":
outcome, reason = "failed", "testmon database recorded failure"

P1 Badge Do not use stale database rows as shard outcomes

When a shard is interrupted after collection but before one or more selected nodes start, seed mode may already have successful rows for those nodes because it updates an existing testmon database. This fallback labels those unexecuted nodes as passed; _checkpoint_testmon_seed_shard can consequently persist the shard as complete, and an interrupted outer verify followed by resume skips it and may publish a green seed without those nodes running. The pre-sharding finalizer deliberately disabled this fallback for exactly this case, so shard completion should likewise require current-shard events rather than pre-existing SQLite results.

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

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head a50b4b548 after the end-to-end discovery pass. Confirm the seed preserves the repository marker contract by excluding benchmark campaigns from the correctness/testmon corpus, while retaining scale/slow selection and complete shard coverage.

@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: 136c2ef18c

ℹ️ 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 devtools/verify.py Resolved
Comment thread devtools/verify.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 31761e978 after the end-to-end run exposed and fixed a second selection defect: marker filtering admitted unmarked tests under tests/benchmarks/. The seed now structurally excludes that explicit campaign directory while retaining complete non-integration correctness coverage and fail-closed shard accounting.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 31761e9785

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

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

🤖 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 `@devtools/verify.py`:
- Around line 2617-2642: The expected node IDs must be normalized before shard
validation and digest generation. In devtools/verify.py lines 2617-2642, update
_prepare_testmon_seed_shards to sort expected after fallback selection and hash
the normalized order. In tests/unit/devtools/test_verify.py lines 332-370, use
fixture node IDs in a non-sorted collection order and compute expected_digest
from sorted IDs so the resume round-trip verifies normalization.

In `@tests/unit/devtools/test_pytest_progress_plugin.py`:
- Around line 14-23: The autouse fixture _restore_plugin_state must preserve
supervisor-provided event destinations during pytest execution instead of
deleting them globally. Move environment clearing into the specific direct
plugin-call setup that needs test-owned paths, and retain managed values for the
lifecycle; add a regression test confirming a plugin test writes its node event
to the supervisor ledger.

In `@tests/unit/devtools/test_verify.py`:
- Around line 332-370: Update the resume test fixture to use node IDs whose
collection order differs from sorted order, while preserving the shard
assignment. Compute _atomic_payload["expected_digest"] from sorted(expected),
and update the selection.json and events.jsonl fixtures to reference the ordered
shard node (ordered[0]). Keep the existing completed-shard and resume assertions
unchanged.
🪄 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: 478134a7-9d12-456c-8476-7d883579eebe

📥 Commits

Reviewing files that changed from the base of the PR and between 8b69a6b and 265cf41.

📒 Files selected for processing (7)
  • devtools/checkout_guard.py
  • devtools/testmon_state.py
  • devtools/verify.py
  • tests/conftest.py
  • tests/unit/devtools/test_pytest_progress_plugin.py
  • tests/unit/devtools/test_verify.py
  • tests/unit/test_pytest_temp_policy.py

Comment thread devtools/verify.py Resolved
Comment thread tests/unit/devtools/test_verify.py Resolved

@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: 265cf41b09

ℹ️ 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 devtools/verify.py Resolved
Comment thread tests/conftest.py Resolved
Comment thread tests/conftest.py Resolved
@Sinity

Sinity commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

ℹ️ 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 devtools/verify.py Resolved
Comment thread devtools/verify.py Resolved
Sinity added 2 commits August 12, 2026 10:17
Problem: the fresh convergence-property seed exposed fixture failures before the intended laws could run. Raw and attachment references were admitted without published bytes, append fixtures required an inapplicable FTS mutation, and readiness fixtures lacked parser-authority receipts.

What changed: publish fixture raw and attachment blobs through the archive publisher, record complete parser census evidence for admitted raws, refresh the FTS freshness ledger after both stages, and preserve the raw-replay mutation's intended comparator failure when raw acquisition is bypassed.

Compatibility: test infrastructure only; production convergence behavior is unchanged.
Keep cold annotation reads on the default read-only archive handle and reopen a writable handle for retries. Derive delegation target and evidence identities from persisted action rows so the fixture follows the current message identity law.

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

♻️ Duplicate comments (1)
devtools/verify.py (1)

2623-2636: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Normalize fresh selection node IDs before persistence.

_testmon_seed_expected_nodeids validates expected_digest from sorted(expected). Line 2636 hashes the unsorted collection order when this is a new seed. A non-lexical collection then fails validation on resume and cannot recover its persisted expected node IDs.

  • devtools/verify.py#L2623-L2636: sort expected after the selection fallback and before shard validation and digest generation.
  • tests/unit/devtools/test_verify.py#L310-L345: pass prepared to checkpointing, or assert its persisted expected node IDs and digest, so unsorted collection input verifies this contract.
🤖 Prompt for 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.

In `@devtools/verify.py` around lines 2623 - 2636, The fresh selection flow in
devtools/verify.py lines 2623-2636 must sort expected after the selection
fallback and before validate_seed_shard_ledger and digest generation, ensuring
persisted node IDs and expected_digest use canonical lexical order. Update
tests/unit/devtools/test_verify.py lines 310-345 to pass prepared to
checkpointing or assert the persisted expected node IDs and digest using
unsorted input.
🤖 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 `@tests/unit/devtools/test_pytest_progress_plugin.py`:
- Around line 103-105: Strengthen the assertions over the test_report events in
the test by requiring exactly three reports, all for the configured target
nodeid, with setup/call/teardown phases, expected passed outcomes, and run_id
equal to "subprocess-regression". Validate the complete payload identity rather
than only comparing the set of when values.

---

Duplicate comments:
In `@devtools/verify.py`:
- Around line 2623-2636: The fresh selection flow in devtools/verify.py lines
2623-2636 must sort expected after the selection fallback and before
validate_seed_shard_ledger and digest generation, ensuring persisted node IDs
and expected_digest use canonical lexical order. Update
tests/unit/devtools/test_verify.py lines 310-345 to pass prepared to
checkpointing or assert the persisted expected node IDs and digest using
unsorted input.
🪄 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: 4794ac48-eae7-4177-a5ff-594f0cc8eccb

📥 Commits

Reviewing files that changed from the base of the PR and between 265cf41 and 0f60850.

📒 Files selected for processing (7)
  • devtools/verify.py
  • tests/conftest.py
  • tests/infra/convergence_harness.py
  • tests/unit/annotations/test_durable_storage.py
  • tests/unit/annotations/test_importer.py
  • tests/unit/devtools/test_pytest_progress_plugin.py
  • tests/unit/devtools/test_verify.py
💤 Files with no reviewable changes (1)
  • tests/conftest.py

Problem: serial explicit-node shards replaced pytest-testmon's controller-owned xdist write path, stretching the seed into dozens of process startups.

Restore one managed xdist pytest-testmon invocation, retain event-backed per-node outcomes and graph validation, and remove the shard-only receipt protocol.

@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: 0f60850904

ℹ️ 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 tests/conftest.py
Comment on lines +409 to +410
"POLYLOGUE_PYTEST_SELECTION_PATH",
"POLYLOGUE_PYTEST_SUMMARY_PATH",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Isolate nested pytest selection ledgers

When a seed shard runs one of the load-sensitive supervisor tests on a host with user systemd, preserving this path lets tests/unit/devtools/test_pytest_supervisor.py::_xdist_controller_cmd() inherit the outer shard's selection destination through env = os.environ.copy(). That nested pytest invocation loads the progress plugin and overwrites selection.json with its single temporary node; _checkpoint_testmon_seed_shard() then sees a selection mismatch, marks the otherwise executed shard incomplete, and every resume repeats the same failure. Preserve the event stream if needed, but scrub or replace the selection and summary destinations for pytest processes launched by test code.

AGENTS.md reference: AGENTS.md:L338-L341

Useful? React with 👍 / 👎.

Comment thread tests/infra/convergence_harness.py Resolved
Comment thread tests/infra/convergence_harness.py Resolved

@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: 602474e034

ℹ️ 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 devtools/checkout_guard.py Resolved
Comment thread devtools/verify.py Resolved
Comment thread tests/infra/convergence_harness.py Resolved

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

ℹ️ 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 tests/conftest.py
Comment on lines +406 to +408
"POLYLOGUE_VERIFY_RUN_ID",
"POLYLOGUE_PYTEST_EVENTS_DIR",
"POLYLOGUE_PYTEST_EVENTS_PATH",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Isolate nested pytest events from the seed ledger

When a test launches a nested pytest process during a managed seed, preserving this event directory and the outer POLYLOGUE_VERIFY_RUN_ID makes the nested process append reports that are indistinguishable from the outer run's evidence. _seed_node_outcomes_from_events() accepts every report by node ID without checking PID or execution provenance, so if the nested process passes another expected node and the outer run terminates before executing that node itself, finalization can treat it as freshly passed. Preserve the outer plugin environment for the parent process, but give subprocess pytest runs a separate event destination/run ID or filter their events out.

AGENTS.md reference: AGENTS.md:L338-L341

Useful? React with 👍 / 👎.

Comment thread polylogue/daemon/convergence_stages.py Resolved
Comment thread polylogue/daemon/convergence_stages.py Resolved
Comment thread tests/infra/convergence_harness.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: 5

🤖 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/daemon/convergence_stages.py`:
- Line 401: Update the convergence stage around
record_fts_freshness_snapshot_sync so the recorder returns an explicit success
status, returning False when snapshot generation catches sqlite3.Error and
succeeds otherwise. In DaemonConverger’s stage handling, propagate that result
and return False instead of reporting convergence success when freshness
snapshot recording fails.
- Around line 754-757: Remove the direct connection_profile import from the
daemon convergence stage and replace the
open_connection/_record_convergence_fts_freshness_sync flow with an existing
operations, insights, or api boundary for the archive freshness update. Keep the
same archive operation behavior while ensuring daemon surface code no longer
imports storage internals.
- Around line 756-757: Update the convergence freshness callback around
DaemonConverger to stop importing or calling open_connection directly. Route the
_record_convergence_fts_freshness_sync write through an existing allowed
daemon-boundary interface in insights, operations, or api, while preserving the
current freshness-recording behavior.

In `@tests/conftest.py`:
- Around line 648-650: Update _restore_plugin_state in tests/conftest.py to
clear POLYLOGUE_PYTEST_SELECTION_PATH and POLYLOGUE_PYTEST_SUMMARY_PATH only for
direct helper calls, preserving supervisor-managed destinations during report
hooks; retain the subprocess regression behavior. In
tests/unit/devtools/test_pytest_progress_plugin.py lines 20-27, adjust the
affected test expectations or setup to reflect the preserved destinations.

In `@tests/unit/devtools/test_pytest_progress_plugin.py`:
- Around line 106-115: Extend the test around subprocess.run to create sentinel
contents in both selection and summary destination files before launching the
child process. After the child exits, read both files and assert their contents
remain unchanged, alongside the existing reports assertions.
🪄 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: 83012f64-fbd4-4192-a972-b9fda44ce7a0

📥 Commits

Reviewing files that changed from the base of the PR and between 0f60850 and 1203919.

📒 Files selected for processing (6)
  • devtools/verify.py
  • polylogue/daemon/convergence_stages.py
  • tests/conftest.py
  • tests/infra/convergence_harness.py
  • tests/unit/devtools/test_pytest_progress_plugin.py
  • tests/unit/devtools/test_verify.py

Comment thread polylogue/daemon/convergence_stages.py Resolved
Comment thread polylogue/daemon/convergence_stages.py Resolved
Comment thread polylogue/daemon/convergence_stages.py Outdated
Comment on lines +756 to +757
with open_connection(archive_db) as conn:
_record_convergence_fts_freshness_sync(conn)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline polylogue/daemon/convergence.py --items all --match 'DaemonConverger|converge'
rg -nP --type=py -C 4 '\.(?:execute|execute_many|execute_sessions)\s*\(' polylogue/daemon
rg -nP --type=py -C 4 'ProcessPoolExecutor|ThreadPoolExecutor|multiprocessing|Process\(|converge_sessions' polylogue/daemon

Repository: Sinity/polylogue

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- DaemonConverger implementation ---'
sed -n '150,590p' polylogue/daemon/convergence.py

printf '%s\n' '--- DaemonConverger call sites ---'
rg -n -P --type=py -C 6 'DaemonConverger\s*\(|\.converge_(?:file|batch|sessions|all)\s*\(' polylogue

printf '%s\n' '--- Worker and process boundaries ---'
rg -n -P --type=py -C 8 'ProcessPoolExecutor|ThreadPoolExecutor|multiprocessing|multiprocessing\.|concurrent\.futures|worker|worker_process|Process\s*\(' polylogue/daemon polylogue | head -n 500

printf '%s\n' '--- Freshness stage definition and callback wiring ---'
rg -n -P -C 10 'make_fts_freshness_stage|_record_convergence_fts_freshness_sync|record_fts_freshness_snapshot_sync|open_connection\s*\(' polylogue/daemon/convergence_stages.py

Repository: Sinity/polylogue

Length of output: 50372


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Freshness stage wiring ---'
rg -n -P -C 14 'make_fts_freshness_stage|_record_convergence_fts_freshness_sync|record_fts_freshness_snapshot_sync|open_connection\s*\(' polylogue/daemon/convergence_stages.py

printf '%s\n' '--- Convergence construction and execution ---'
sed -n '1720,1780p' polylogue/daemon/cli.py
sed -n '2500,2605p' polylogue/daemon/cli.py
rg -n -P -C 12 'converger\s*=|_converger|Converger|converge_file|converge_batch|converge_sessions' polylogue/sources/live/batch.py polylogue/daemon/cli.py

printf '%s\n' '--- Live batch worker boundary ---'
rg -n -P -C 12 'process_pool_executor|ProcessPoolExecutor|executor\.(map|submit)|worker|_run_batch|_validate_record_sync' polylogue/sources/live/batch.py polylogue/pipeline/services polylogue/daemon/cli.py | head -n 500

Repository: Sinity/polylogue

Length of output: 50372


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import ast
from pathlib import Path

root = Path("polylogue")
target_methods = {"converge_file", "converge_batch", "converge_sessions", "converge_all"}
process_names = {
    "ProcessPoolExecutor",
    "process_pool_executor",
    "multiprocessing",
    "Process",
}

for path in sorted(root.rglob("*.py")):
    try:
        tree = ast.parse(path.read_text(), filename=str(path))
    except (OSError, SyntaxError):
        continue

    for node in ast.walk(tree):
        if isinstance(node, ast.Call):
            func = node.func
            if isinstance(func, ast.Attribute) and func.attr in target_methods:
                print(f"CONVERGENCE_CALL {path}:{node.lineno}: .{func.attr}()")
            if isinstance(func, ast.Name) and func.id in process_names:
                print(f"PROCESS_CALL {path}:{node.lineno}: {func.id}()")
            if isinstance(func, ast.Attribute) and func.attr in process_names:
                print(f"PROCESS_CALL {path}:{node.lineno}: .{func.attr}()")

    for node in ast.walk(tree):
        if isinstance(node, ast.ImportFrom) and node.module:
            imported = {alias.name for alias in node.names}
            if imported & process_names:
                print(f"PROCESS_IMPORT {path}:{node.lineno}: {node.module}: {sorted(imported & process_names)}")
        elif isinstance(node, ast.Import):
            imported = {alias.name.split(".")[0] for alias in node.names}
            if imported & process_names:
                print(f"PROCESS_IMPORT {path}:{node.lineno}: {sorted(imported & process_names)}")
PY

Repository: Sinity/polylogue

Length of output: 1646


Route the freshness write through an allowed daemon boundary.

DaemonConverger has no process-pool convergence call sites, so this callback does not need a main-process queue. However, record() directly imports polylogue.storage.sqlite.connection_profile.open_connection, which violates the daemon boundary. Route the write through insights, operations, or api.

🤖 Prompt for 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.

In `@polylogue/daemon/convergence_stages.py` around lines 756 - 757, Update the
convergence freshness callback around DaemonConverger to stop importing or
calling open_connection directly. Route the
_record_convergence_fts_freshness_sync write through an existing allowed
daemon-boundary interface in insights, operations, or api, while preserving the
current freshness-recording behavior.

Source: Coding guidelines

Comment thread tests/conftest.py Resolved

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

ℹ️ 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 tests/conftest.py Resolved
Comment thread tests/infra/convergence_harness.py Resolved
@Sinity
Sinity merged commit 595c4d9 into master Aug 12, 2026
2 checks passed
@Sinity
Sinity deleted the feature/fix/testmon-sharded-seed branch August 12, 2026 10:35

@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: 31e08362ba

ℹ️ 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 tests/infra/convergence_harness.py Resolved
Comment thread tests/infra/convergence_harness.py Resolved
Sinity added a commit that referenced this pull request Aug 12, 2026
## Summary

Record complete testmon seed outcomes without treating fixture teardown
as proof that the test body passed.

## Problem

Interrupted or worker-disrupted shards can retain `test_finished` plus a
passing teardown report without a call-phase report. A failed test can
therefore be incorrectly terminalized and skipped on resume; an
unrecorded call can be treated as passed.

## Solution

- record complete per-node seed outcomes and preserve resumable shard
state;
- require call-phase evidence or a corroborating testmon result before
accepting a passing teardown;
- keep missing, failed, worker-crash, timeout, and interrupted outcomes
distinct;
- isolate unit-test testmon caches so checkout-integrity tests observe
real state;
- preserve the managed event ledger across the host environment scrub.

## Verification

- `.venv/bin/python -m devtools test tests/unit/devtools/test_verify.py
tests/unit/devtools/test_testmon_state.py
tests/unit/devtools/test_checkout_guard.py
tests/unit/devtools/test_pytest_progress_plugin.py` — 196 passed;
- `.venv/bin/python -m devtools verify --quick` — 25/25 steps passed at
`eda8751e3`;
- current-head Codex review was addressed with a regression test for
teardown-only evidence.

This PR is self-contained on top of the already-merged testmon sharding
work in #3956.

<!-- polylogue-pr-scope:v2
{
  "assigned_beads": [],
  "dispositions": [],
  "mutated_beads": [],
"scope_digest":
"79a7984a9ec80a157c96dc8d28561159c642c15de3793837eff751fa7eac34a1",
  "scope_kind": "self_contained",
  "version": 2
}
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added durable, resumable test verification through deterministic
shards.
* Verification now records per-shard progress and outcomes, allowing
interrupted runs to continue safely.
* Added validation to ensure complete and consistent test coverage
before finalizing results.

* **Bug Fixes**
* Improved handling of teardown outcomes so incomplete tests are not
incorrectly marked as successful.
  * Benchmark tests are excluded from standard verification collection.
  * Improved freshness and readiness checks for search-related data.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

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

  • 52.F035 / P1: stale at the checked revision: The checkout guard no longer reads seed.json, protocol-versioned seed attempts, or unpublished completion receipts. Verification uses the checkout-local testmon datafile model, while command admission performs interpreter and import-root checks rather than the removed seed-marker protocol. Current code: devtools/testmon_provision.py:3; devtools/click_dispatch.py:318; devtools/click_dispatch.py:323.

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

@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

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

  • 78.F048 / P1: Fix and current-source recheck assigned to polylogue-kx9vb; not claimed fixed. The autouse fixture still removes outer event destinations throughout test execution at tests/unit/devtools/test_pytest_progress_plugin.py:29. The real plugin resolves those environment variables dynamically in _write_event at devtools/pytest_progress_plugin.py:135-138, so call reports are dropped or redirected before the fixture restores them.

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

@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

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

  • 54.F068 / P1: fixed-already at the checked revision: The common managed pytest command applies IGNORED_COLLECTION_ARGS (devtools/verify.py:287), whose explicit tests/benchmarks exclusion prevents performance campaigns from entering native full or affected correctness collections (devtools/pytest_invocation.py:148).
  • 54.F069 / P1: stale at the checked revision: The persisted shard COMPLETE checkpoints and their database-outcome fallback no longer exist. Complete verification now executes one full collection with --testmon-noselect (devtools/verify.py:279), rather than skipping unexecuted shards based on pre-existing passing rows.
  • 54.F070 / P1: stale at the checked revision: The loop launching a sequence of independently timed seed shards has been removed. The replacement full route builds one pytest collection (devtools/verify.py:243); its optional second contract-document step is restricted to affected mode (devtools/verify.py:256).

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 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 55.F110 / P2: stale at the checked revision: test_scale_tiers no longer declares scale_small correctness tests part of default verification. Its module contract now explicitly assigns the file to the performance-plugin surface excluded by path (tests/benchmarks/test_scale_tiers.py:5-6), so the old default-correctness claim does not describe the pin.
  • 55.F111 / P2: stale at the checked revision: The resume path preferring an old expected-node ledger over fresh collection has been removed. The complete route executes the current full collection with --testmon-noselect on each invocation (devtools/verify.py:279), rather than replaying persisted shards.
  • 55.F112 / P2: stale at the checked revision: Seed shards and their repeated fixed report filenames have been removed. The current runner rebinds JSON and JUnit outputs into each run-specific step directory (devtools/verify.py:648), preserving the actual executing step instead of replacing previous shard evidence.
  • 55.F113 / P2: stale at the checked revision: There is no persisted complete-shard skip loop or resumable seed finalizer at the pin. An explicit complete run executes and traces the full collection with --testmon-noselect (devtools/verify.py:279), including tests needed to repopulate the graph.

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

Sinity added a commit that referenced this pull request Oct 1, 2026
## Summary

Restore the corpus, progress receipt, hash and incremental-work
verification contracts behind six historical findings. Attachment
ingestion keeps native authored turns, lineage and durable bytes through
ordinary parsing and retained replay.

## Problem

Executable corpus generators supplied arbitrary transcript bytes; Attach
projected native transcripts into a lossy single-turn envelope. Nested
progress tests could steal the managed run ledger. The restored-content
hash fixture expected unequal hashes for equal content. The incremental
law allowed archive-wide refreshes through relaxed budgets and
incomplete SQL measurement.

The original findings remain linked in polylogue-kx9vb:
[F003](#3889 (comment)),
[F004](#3889 (comment)),
[F048](#3956 (comment)),
[F081](#3524 (comment)),
[F088](#3842 (comment)),
[F089](#3890 (comment)).

## Solution

- Generate provider-valid native acquisitions/appends/replacements, and
require actual retained admission and convergence evidence before
advancing reference operations.
- Keep native provider records in the existing capture envelope,
delegate to ordinary Codex/ChatGPT/Claude parsers, and merge durable
attachment evidence. Guard native/envelope identity and witnessed idless
ownership. Preserve native ordering, semantic fields, selected leaf and
fork lineage on replay.
- Bind the loaded progress plugin's destinations to its session, isolate
nested hook tests and verify the real outer ledger.
- Compare final semantic message fields and exact ordered blocks before
equal production hashes; changed content is a separate negative control.
- Measure actual SQLite statements and VM work. Require zero
archive-wide derived writes and fixed-component work stable at sizes
2/8/32. Sixty-two populated write/reset/DROP mutants and an archive-wide
read negative control exercise ordinary SQL owners, including
quoted/qualified targets, conflict modifiers and SQL comments.
Comment-looking bytes inside quoted tokens are preserved. Raw SQLite FTS
shadow traces remain measurable VM evidence.

## Verification

Final candidate: `2e44e4fb4c11b0c2f8d2385262efb31f4164e549`, tree
`d901f0d94508e92d9e7f7355dedaa54404ec1527`, including master
`ca80dade13d9bf51a4c4eed9fd1cb04be8b4751c`.

```sh
agentctl job start polylogue pytest_focused --workspace /realm/worktrees/polylogue-verification-p1 -- tests/unit/storage/test_rebuild_complexity.py -q
agentctl job start polylogue verify_quick --workspace /realm/worktrees/polylogue-verification-p1
```

- Job 5435: **69 passed in 2088.51s**, exit 0, receipt
`20261001T065605Z-focused-test-11546-a3be8b3e`, on the clean unchanged
candidate. Selected/setup/call/teardown/terminal sets are exactly equal
(69 each). All 62 populated mutants, strict baseline, unrelated-growth
read control, scoped/literal controls and the actual FTS shadow VM
witness passed.
- Job 5436: **all 12 gates passed**, exit 0, receipt
`20261001T065607Z-quick-11633-8fcbd248`, on the clean candidate.

Earlier complete verification is reused only where its files and
production dependencies remain unchanged:

```sh
agentctl job start polylogue pytest_focused --workspace /realm/worktrees/polylogue-verification-p1 -- tests/infra/test_corpus_program.py tests/infra/test_timeout_policy.py tests/unit/devtools/test_pytest_progress_plugin.py tests/unit/storage/test_rebuild_complexity.py tests/unit/storage/test_archive_tiers_write.py tests/unit/sources/test_browser_capture.py tests/unit/maintenance/test_browser_spool_restoration.py -q
agentctl job start polylogue pytest_focused --workspace /realm/worktrees/polylogue-verification-p1 -- tests/unit/sources/test_browser_capture.py tests/unit/maintenance/test_browser_spool_restoration.py -q
```

Job 5403: **345 passed in 1932.86s**, exit 0, receipt
`20261001T050040Z-focused-test-3975611-05cd7b7f`, on clean
`18c25b2e467ba108b30fefff09e99a1819db6bc6`.
Selected/setup/call/teardown/terminal sets are exactly equal (345 each),
including the loaded outer plugin receipt. Its corpus, timeout, plugin
and archive writer/hash scope is unchanged. Its earlier SQL measurement
is superseded by job 5435.

Job 5418: **105 passed in 50.55s**, exit 0, receipt
`20261001T055219Z-focused-test-4080362-18b92b28`, on clean integrated
`f2af9adf78a83a87e7ea2b2e0fc85f9743db1210`. The five event/selection
sets contain exactly the same 105 nodes. These parser/spool files and
production dependencies remain unchanged. The master integration changed
daemon/read consumers; this complete two-module selection covered them.
All 19 owned files outside the SQL counter and complexity test are
byte-identical to that reviewed head. This does not claim that all 345
tests ran on the final candidate.

The independent full-diff review found SQL comment spellings that
bypassed the global-write classifier. The correction covers all sibling
header positions and protects quoted identifiers/literals. Job 5423 then
reported **67 passed and 1 failed in 2305.49s**; its unchanged-tree
retry also failed. The scoped fixture incorrectly required one trace
although SQLite repeats trigger traces and opening an archive performs
other-tier bootstrap writes. The correction asserts real changed rows
and every relevant index trace. An actual FTS diagnostic also exposed
dropped shadow VM attribution; the final counter keeps raw trace
evidence separate from normalized classification, and its new populated
regression observes real positive FTS shadow VM work.

The original diagnostic reported 156 passed and 3 failed, including an
actual 120-second timeout during progressing 32-session work. Explicit
timeout 0 now uses managed progress/cancellation; the timeout was not
raised and the comparison corpus was not reduced. Earlier
complete-selection failures and unchanged-tree diagnoses remain recorded
in the task. Job 5401 failed the identifier extraction typing gate (11
gates passed), corrected before 5403/5404; job 5400 was cancelled before
collection. A passing retry of the transient accepted-await failure does
not establish its runtime cause.

## Self-review

Author full-diff review on clean
2e44e4f/tree
d901f0d against master
ca80dad. All 21 owned paths and
connected call paths were reread in this context. The final cumulative
two-path correction was reviewed as new code; no remaining concrete code
finding. Full SQL job 5435 passed 69 tests in 2088.51 seconds on this
clean unchanged head, receipt
20261001T065605Z-focused-test-11546-a3be8b3e;
selected/setup/call/teardown/terminal sets are exactly equal (69 each).
Final quick 5436 passed all 12, receipt
20261001T065607Z-quick-11633-8fcbd248. Independent whole 21 review at
f2af remains valid for 19 unchanged blobs; final cumulative correction
review and exact receipt readback are clean on the same immutable head.
Earlier original 156 passed/3 failed and 120-second timeout and all
subsequent diagnostics remain visible. In particular, 5423 failed with
67 passed/1 failed (same unchanged-tree retry), caused by invalid
single-trace fixture expectation; FTS shadow diagnostic also exposed
dropped actual VM work. Both corrected in 2e.

1. ✓ Siblings and owners. Both corpus generators construct native-valid
Acquire/Append/Replace. Native identity is checked before merge in all
three native provider routes (definition+3 call sites). The SQL census
covers all five derived surfaces, all actual action/FTS/delegation
scoped owners, and supported target quote/qualification/conflict/comment
forms. Genuine comments are stripped once for write classification; raw
SQLite trace annotations remain VM evidence. No new source exclusion or
detector owner was introduced.
2. ✓ The fix itself. Re-read every owned hunk as new code.
Source-revision reuse prefers exact source/path/wire evidence, then
independently retained equal-wire evidence. Idless attachments require
explicit retained ordinal plus actual parsed role/text, then the
existing private owner coordinate. Target normalization protects quoted
tokens and preserves scoped predicate checks. Real FTS shadow VM work
remains measured; the recorder control allows actual trigger trace
repetition and asserts every index event retains the declared literal.
3. ✓ Memory and limits. Native arrays are streamed record by record into
a constant-size digest/root-shape placeholder. Synthetic fixture helpers
materialize only their generated transcript. Identifier-token matches
cover at most a two-part target, not archive rows. No new acceptance
cap; explicit timeout(0) delegates the progressing 32-session seed to
managed cancellation instead of increasing its 120-second cutoff.
4. ✓ Cost per unit. The selected component stays one at archive sizes 2,
8 and 32. Real SQLite VM progress and trace callbacks measure work.
Global writes must be exactly zero; fixed-component VM work cannot grow
with unrelated rows. No statement budget or multiplier. The archive-wide
read mutant tests the second law independently.
5. ✓ Interruption. Acquisition/parsing backends close in finally.
Reference operations advance only after acquired/parsed/converged
evidence. Restart and cold retained replay are exercised. The loaded
progress plugin restores prior active session/environment/ledger in its
existing sessionfinish finally.
6. ✓ Ordering and races. Acquired bytes and path key source revisions.
Native mapping insertion order is preserved in attachment wire
serialization; record order remains fingerprint-sensitive. Selected
composed leaf is independently asserted as child-tail before comparing
all semantic fields. Managed checks bind clean frozen heads; final quick
5436 binds clean 2e44e4f, and full affected SQL job 5435 passed on
that same head.
7. ✓ Failure classification. Actual AcquireResult errors, ParseResult
failures and failed/pending FileState produce typed corpus refusals.
Native/envelope identity disagreement refuses before evidence
composition. Missing/conflicting ordinal witness refuses. No broad
SQLite/OSError exclusion handler was added.
8. ✓ Silent outcomes. Known skipped duplicate admission requires
retained byte proof. Failed parsing or pending daemon stages cannot mark
Converge applied. The retained job 5403 receipt proves 345
selected/call/terminal nodes on 18c, including the outer plugin events;
the plugin scope is unchanged. Quick alone proves no behavior.
9. ✓ Cleanup on failure. Existing backend finally cleanup survives new
refusal paths. Nested hook tests use a fresh module and monkeypatch
restoration; the real loaded outer plugin keeps its own ledger. All
archives/probes remain isolated synthetic scratch, with no live service
mutation.
10. ✓ Identity and keys. Native provider IDs remain unchanged; no
ordinal-based provider ID fabrication. All three native session branches
refuse identity conflicts. Equal actual semantic fields and exact
ordered blocks are asserted before equal production hashes, with
changed-content negative control. No reverse Origin-to-Provider lookup
or product hash change.
11. ✓ Lossless transforms. Ordinary native parsers own message
fields/topology. Capture raw records and durable attachment descriptors
replay through the same parser/writer. Exact stored row/position/hash
oracles cover web providers; composed child transcript normalizes only
physical ownership and contextual leaf while asserting actual selected
leaf identity. Source field-choice rules are checked at both
modern/legacy fork carriers.
12. ✓ Degenerate inputs. Tests cover empty/unsupported Codex arrays,
malformed bytes/JSONL, foreign IDs, missing/negative/outside/role/text
ordinal witnesses, same-byte duplicate coordinates and A→B→A source
revisions. Timeout policy rejects booleans, negatives, nonfinite values
and nonnumbers; zero remains explicit cancellation semantics.
13. ✓ Consumers. Model, stream summary, ordinary native parser,
attachment fixture helper, docs and ownership census agree. Existing
envelope remains the retained format; no Codex page UI support claimed.
Synthetic single-turn/original_payload_b64 predecessor and relaxed SQL
budgets are removed. Coordinated browser compact retirement is preserved
for its separate owner.
14. ✓ Tests and stubs. Real acquisition/parsing and daemon convergence
run; public ingestion fixtures enable the required resident derivation
capability while a negative test preserves its refusal. SQL mutants
execute once on populated production-opened relations and prove actual
changed rows/index contents before the law rejects them. All five INSERT
conflict modes use fresh rowids to ensure IGNORE is nonvacuous. Loaded
plugin surrounds real nested pytest.
15. ✓ Trust boundaries. Native identity guards precede attachment/events
merge. Public fixtures contain neutral synthetic content only; private
analyses, run receipts and databases are untracked. Refusal text avoids
native session IDs. No paid provider or operator archive calls.
16. ✓ Devtools selection. The seven-file receipt 5403 binds 345
selected/call/terminal nodes to clean 18c; final parser/spool receipt
5418 binds 105 nodes to clean f2af. Only their unchanged scopes are
reused. Cumulative SQL corrections passed complete module 5435 on 2e (69
nodes, identical selected/report/terminal sets). Final quick 5436 passed
all 12 gates including closure. No zero-test or corpus fallback. The
prior 5401 failure remains visible; 5400 cancelled before collection,
not reported as tests run.
17. ✓ Index/ops evolution. Model code lies in the computed derived
closure; stream/parser do not. No manual identity bump or derived
migration. Post-master old private archive correctly refused SchemaSkew
rather than weakening validation. Earlier clean 18c fixtures passed 345
tests; the strict baseline completed in 220.009 seconds. Current
corrected SQL job 5435 passed 69 tests. No timeout increase or weakened
law.
18. N/A Embeddings durability. No embeddings DDL/version/vector
replacement/deletion. New archives are synthetic fixture roots using
existing initialization.
19. N/A Durable enum checks. No durable DDL or vocabulary changes.
Existing durable-enum-checks gate remains required.
20. ✓ Writer authority. Public facade fixtures use existing
daemon_serving_archive with session_derivation capability; direct
mutation is isolated declared fixture/replay setup only. No new live
write bypass or authority.
21. ✓ Durable mutation authority. Source retains native records and
attachment bytes; index derives parsed ownership from that evidence.
Neither an ephemeral parsed overlay nor a rebuilt index row becomes
durable authority.

Generic:

1. ✓ Assigned criteria. Six original findings have actual
production-route regressions; prior 5403/5404 passed on 18c, final
browser consumers 5418/5419 passed on f2af, and quick 5436 passed on 2e.
Corrected full SQL 5435 passed 69 tests; final independent correction
readback is clean. Original identities and inherited failures are
retained; no unrelated Bead closes.
2. ✓ Every site. Sibling searches covered both generators, three native
merge routes, loaded plugin event/selection/summary/worker writers, all
five SQL surfaces and the actual scoped SQL builders. New target census
covers four quote forms, main/temp qualification, case folding and all
five INSERT/UPDATE conflict modes; quoted DELETE/DROP/control variants
share its owner.
3. ✓ Complete changes. Connected
model/stream/parser/caller/docs/census/tests are changed together;
deleted single-turn/opaque payload and relaxed-budget predecessors have
no new callers. No dual format/identity authority added.
4. ✓ Visible failures. Typed acquire/parse/native identity/ownership
refusals reach their actual caller. Pending stages do not imply
completion. Original 120-second timeout and transient accepted-await
failure stay visible; green fixture checks do not claim an unproved
runtime cause fix.
5. ✓ Anti-vacuity. Empty generated Append was observed to fail actual
native-ID oracle in job 5167. Rich/restored hashes require independently
equal final fields+ordered blocks; changed text differs. All 62 actual
populated once-per-pass write/reset/DROP mutants must be rejected, plus
actual unrelated-growth read negative control. All 62 passed precursor
5423; final 5435 reproved them with raw FTS accounting restored. Its
dedicated populated FTS control requires positive observed shadow VM
work, without inventing a numeric budget or attributing data_version
PRAGMA work to derived tables. Removing native raw records, identity
guard, fork carrier or ownership coordinate breaks exact retained/replay
assertions.
6. ✓ Public boundary. Read all 21 owned paths; only synthetic fixtures
tracked. Private receipts/probes/archives excluded. Publication will
give exact commands/run IDs, not transcript/private analysis content.

## Residuals

Verification covers the named selections, not the full corpus or
operator archive. The operation.await lifecycle defect remains with its
separate source foundation owner; this change makes no runtime cause
claim. The operator disabled further hosted Codex requests; the full
21-file independent review at f2af is retained, and its final two-file
correction readback is clean at 2e. Publication requires required
statuses and resolution of all six existing review threads.
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

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

  • 63.F052 / P2: fixed-already at the checked revision: The current readiness-binding stage rolls back and re-raises inspection/publication exceptions at polylogue/daemon/convergence_stages.py:657-660. It does not return True after a swallowed freshness-snapshot failure, allowing the converger to retain a failed stage outcome.
  • 63.F053 / P2: fixed-already at the checked revision: The live watcher now defaults whole_archive_convergence to False at polylogue/sources/live/watcher.py:1292 and forwards it into the batch processor. The converger skips whole-archive stages before checking or executing them at polylogue/daemon/convergence.py:1365-1368, and the FTS readiness publisher is explicitly whole_archive=True at polylogue/daemon/convergence_stages.py:681, so ordinary live batches no longer run the global freshness inspection.

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 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 76.F097 / P1: fixed-already at the checked revision: Managed nested executions mint a new pid/time-based basetemp rather than deriving it from the inherited pytest run ID; the old cleanup_managed_pytest_basetemp route is absent. See devtools/pytest_slot.py:382.
  • 76.F100 / P1: fixed-already at the checked revision: Nested managed focused launches explicitly discard the inherited containment receipt; the per-test preserved-variable set also excludes POLYLOGUE_PYTEST_CONTAINMENT_PATH. See devtools/run_tests.py:1354.
  • 76.F101 / P1: fixed-already at the checked revision: The autouse fixture preserves the managed run/event destinations via the explicit allowlist and no longer deletes them merely because PYTEST_CURRENT_TEST is present in the outer process. See tests/conftest.py:722.
  • 76.F113 / P1: fixed-already at the checked revision: The harness again exposes write_source_raw_session and calls that exact module attribute while ingesting fixtures, so the retained mutation hook can be patched instead of failing with AttributeError. See tests/infra/convergence_harness.py:67.
  • 76.F114 / P1: stale at the checked revision: The current harness exercises the parsed-session write boundary and no longer asserts byte-prefix admission of its normalized full JSON payloads. Its replay helper replays those same parsed writes rather than the removed raw-admission branch that raised REFUSED_AMBIGUOUS. See tests/infra/convergence_harness.py:204.

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 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 77.F094 / P2: stale at the checked revision: The replacement replay feeds the same selected writes through ingest_composed_sources one call at a time; the former per-call admission-head map and asserted generation-zero baseline path are gone. This fixture now tests parsed-write replay rather than resumable source-admission authority. See tests/infra/convergence_harness.py:555.
  • 77.F095 / P2: stale at the checked revision: The harness no longer constructs a RawRevisionEnvelope using the parsed session hash. It omits revision evidence, leaving source_revision unset at the raw-write seam rather than asserting an incorrect blob identity. See polylogue/storage/sqlite/archive_tiers/source_write.py:780.
  • 77.F096 / P2: stale at the checked revision: The harness no longer fabricates independent asserted FULL revisions with corpus-position generations. Its raw-write seam leaves revision kind unknown and authority quarantined, while append_only selects the downstream parsed-write behavior rather than claiming a byte-proven acquisition chain. See polylogue/storage/sqlite/archive_tiers/source_write.py:779.
  • 77.F097 / P2: stale at the checked revision: The current fixture passes an in-memory ParsedSession directly to the parsed-write boundary and writes no parser-census receipt claiming that the retained normalized JSON reproduces it. The false parser attestation described by this thread has been removed. See tests/infra/convergence_harness.py:282.
  • 77.F098 / P2: fixed-already at the checked revision: The harness now executes the common FTS derivation and checks its validity, then reads readiness without a separate freshness-ledger repair. The retired record_fts_freshness_snapshot_sync masking call is absent. See tests/infra/convergence_harness.py:416.

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