Repository navigation
fix(sources): settle raw admission so the frontier gate has nothing to refuse - #4704
Conversation
…refuse Codex state databases are declared non-session snapshots, an exclusion is lifted only by an admission that retains evidence, Gemini CLI checkpoints are governed by membership authority, an unorderable byte cohort leaves a deferred carrier, and a terminal failure carrier survives reclassification. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
…ntine on admission A cursor commit claims the bytes were consumed and retained, so refuse to advance when the source tier holds no row for the path. Lift a quarantine in the acquisition pass that re-decides the path rather than when the watcher notices it deserves one, so a live database's changing stat cannot leave a stale byte offset visible to the raw-frontier cursor map. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Anti-vacuity per test: reverting the gemini-cli frontier_kind declaration leaves both sibling raws untyped-quarantined with no head, and deleting the acquisition-side revival leaves a parsed path quarantined forever. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e193aa74f
ℹ️ 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".
Noticing that a quarantined path deserves a fresh attempt no longer clears excluded; the cursor write of an ingest that retained something does. A path that fails again therefore stays quarantined, and a never-admitted path never presents a stale byte offset to the raw-frontier cursor map. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 685fb66031
ℹ️ 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".
…on (#4707) ## Summary Restores `CursorStore.revive_replaced_exclusion`'s `excluded=False` write, which #4704 removed by accident. ## Problem `sources/live/cursor_lifecycle.py` declares, as its first preventive invariant, that `revive_replaced_exclusion` is the only actuator permitted to move a cursor `EXCLUDED -> ACTIVE`, and only on a proved file-identity or parser-fingerprint change. #4704 dropped the `excluded=False` write, so that transition became unreachable and two soundness-sweep assertions in `tests/unit/sources/test_cursor_lifecycle.py` — the proved-identity-change and parser-fingerprint-change cases — assert `ACTIVE` against a store that stays `EXCLUDED`. The change was collateral: an earlier revert of it in the lane ran after the commit that introduced it, so it restored the changed file rather than the original. ## Solution Restore the store method to its pre-#4704 behavior. The polylogue-6q16u fix this belonged to lives entirely in `LiveWatcher._needs_work_from_state_uncorroborated`, which no longer calls this method when it merely notices a path deserves a fresh attempt; nothing in the live path depends on the store's own behavior changing too. ## Verification `git show origin/master~1:polylogue/sources/live/cursor.py` and this branch's copy of the method are identical, so the two soundness-sweep cases return to the state they passed in. Residual: the host `pytest` pueue group is paused, so the focused selection (`tests/unit/sources/test_cursor_lifecycle.py`) could not be run locally to confirm. The restored file is byte-identical to the version those tests passed against. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
… retry (#4710) ## Summary Updates the excluded-cursor live proof to the contract #4704 established. ## Problem `tests/unit/sources/test_excluded_cursor_live_proof.py::test_excluded_cursor_revives_through_the_live_watcher_gate` asserts that `LiveWatcher._needs_work` itself calls `CursorStore.revive_replaced_exclusion` and leaves the row `excluded = 0`. #4704 (polylogue-6q16u) removed that call: noticing that a path deserves a fresh attempt no longer lifts its quarantine, because a cleared flag over a stale byte offset is what the raw-frontier cursor map reads as committed ingest authority for a path nothing has admitted. The test is red on master. ## Solution Assert the contract that now holds: `_needs_work` reports True (the fresh attempt is scheduled, which is polylogue-ix5r's requirement) and the quarantine persists, so a path that fails again stays dark. The quarantine is lifted by the cursor write of an ingest that retained something. The proof's recorded `production_route.transition` is updated to name that route. Anti-vacuity: restore the `revive_replaced_exclusion` call in `_needs_work_from_state_uncorroborated` and `actuator.assert_not_called()` plus `assert still_quarantined.excluded` both go red. ## Verification `ruff format` / `ruff check` clean. Residual: the host `pytest` pueue group is paused, so `devtools test tests/unit/sources/test_excluded_cursor_live_proof.py` could not be run. This test is red on master as it stands; the change is the minimal edit that matches the merged behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…on path (#5403) ## Summary Triage of **85 likely-live P1 review findings** anchored in `polylogue/sources/`, from the 2,599-item backlog where **zero review threads have ever been resolved**. **33 STALE (39%) · 1 WONTFIX · 51 LIVE** — 14 fixed here, 37 reported unfixed with reasons. ## How much to trust the filter — the answer for the other 322 **39% stale.** Treat it as a shortlist, not a verdict. Two failure modes dominate and are predictable: 1. **Wholesale refactor.** All seven `watcher.py` findings are stale for *one* reason: the `_flush_pending` / `_pending_paths` / `_debounced_batch` / `_plan_catch_up` machinery no longer exists. **If a cluster names one mechanism, check the mechanism exists before triaging individually.** 2. **Silent follow-up fix.** The `#4520`/`#4662`/`#4663` append-proof cluster was fixed by later PRs that rewrote neighbouring lines and left the anchor byte-identical — several carry comments restating the reviewer's own words, so **grepping HEAD for the finding's key phrase is a fast stale test**. The filter was reliable where the anchor is a self-contained expression: `antigravity.py`, `codex.py`, `origin_specs.py` findings were nearly all still exactly as reviewed. **And LIVE does not mean the reviewer's consequence is right.** `batch.py:2488` reproduces, but the claimed batch abort does *not* happen — a group-level handler catches it. Measured: `failed=2 succeeded=0` → `failed=1 succeeded=1`. **Verify the consequence, not just the code shape.** ## A pre-existing test refuted as vacuous The lane first claimed `test_sqlite_acquisition_failure_is_a_failed_file_not_a_batch_abort` covered the Hermes fix. Removing the fix and running it: **`PASSED exit=0`**. The test offers a *single* file, so chunk and file coincide — it cannot distinguish the defect. Replaced with `test_sqlite_acquisition_failure_does_not_fail_its_healthy_siblings`, which measures the real difference. ## The fourteen, in one line each `batch_support.py:443` an unterminated final line was reported malformed, recording TERMINAL_CORRUPT_INPUT for an ordinary mid-write snapshot · `watcher.py:867` EACCES/EIO escaped with no cursor or debt row · `watcher.py:1222` `excluded=True` alongside the new stat made a path report no-work **forever** · `batch.py:722` a symlink-spelled violation admitted the identical blocked file after restart · `batch.py:4180` two independent opens now bound to one `_file_observation` · `antigravity.py:586` ID-less steps keyed by message count **renamed `step:1` → `step:0`** when an earlier step became malformed · `antigravity.py:985` conflicting `parent_references` asserted an arbitrary durable topology edge · `antigravity.py:830` a null-key trajectory returned zero steps *and* a denominator of 0 · `dispatch.py:1463` GEMINI_CLI resolved sidecars path-independently · `source_acquisition.py:86` a foreign archive root was admitted instead of refused — plus four more. ## Anti-vacuity — all fourteen, one executed reversion `git checkout <base> -- polylogue/`, re-run the reproduction script, restore. Verbatim base → fixed: ``` 1 malformed_record: True -> False 1b terminated: True -> True (opposite pinned) 2 RAISED PermissionError -> recorded, no exception 3 excluded: True -> False; needs_work: False -> True 5 admitted under symlinked block: ['session.jsonl','healthy.jsonl'] -> ['healthy.jsonl'] 9 ['trajectory:step:0'] -> ['trajectory:step:1'] 11 null-key messages: [] -> ['hello'] 11b foreign-key: [] -> [] (opposite pinned) 12 conflicting parents: parent-1 -> None 12b single parent: -> parent-1 (opposite pinned) ``` Three opposite-direction pins are unchanged across the mutation, so a blanket refusal cannot pass. ## Verification ``` devtools test <6 modules> exit 0, 253 passed, git_dirty false devtools test <final sha> exit 0, 43 passed devtools verify --quick exit 0, 25/25 devtools render all --check exit 0, 'out of sync' 0 git merge-tree vs master 0 conflict markers ``` Closure: six `sources/` files **IN**, two `pipeline/services/` **out**. INDEX `ce86c236… → 0936e4a9…`. **Self-corrected**: the commit message quotes an intermediate identity measured before the Drive guard was relocated — the landed value is `0936e4a9…`, and it must be re-measured after rebase. The lane also *moved* its Drive guard rather than grow the closure: placing it in `sources/drive/__init__.py` (IN) added a baseline member for no semantic gain, so it went to `acquisition_streams.py` (OUT) — which is also the reviewer's own preferred site and covers both branches. ## Highest-severity unfixed, filed separately `revision_backfill.py:3668` — a pre-logical-export Codex `state_5.sqlite` **page image** is not in `frozen_codex_state_raw_ids`, reaches the JSON parser, and its exception is promoted to `FrozenSourceRemediationRequiredError`, **aborting the entire index rebuild**. Needs a terminal non-session receipt; naive rejection doesn't provide one. Also reported unfixed with reasons: the parser fingerprint was **never bumped** for two admission-law changes (`#4704`, `#4925`), so unchanged files are skipped forever; sidecar/assembly inputs never re-enrich their owner; the write-hold budget is unenforced outside the full-ingest route. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
|
Closing out open Codex review threads on this PR (evidence checked against master at bf68918):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
|
Closing out open Codex review threads on this PR (evidence checked against master at bf68918):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Four admission defects that each left the raw-frontier source-selection gate
with a row it could neither compare nor settle, so a fresh daemon refused its
whole catch-up backlog.
Problem
Fresh-root rehearsals stopped ingesting with
live watcher source-selection gate blocked: N cursor/head authority row(s) could not be compared. Fourdistinct causes:
checkpoint files that share a
sessionIdand no byte prefix(
session-2026-04-02T10-09-56cb9ec1.jsonand…T10-12-…carry the same idwith different bytes). A byte-revision cohort over that logical key can only
fail to order them, so admission logged
no unique byte-revision candidate acceptedand dropped through, leaving both rawsquarantinedwith noreceipt of any kind for the gate to read.
a path deserved re-deciding, before anything was admitted. The row then sat
excluded = 0carrying its old byte offset until the next acquisition pass,and the raw-frontier cursor map reads exactly that shape as committed ingest
authority with no accepted head. A live database whose stat changes on every
poll re-entered that window on every poll.
raw_artifactsupserts replaceartifact_kindunconditionally on
artifact_idconflict, so an ordinary pathclassification landing on a terminal failure carrier's id takes the row
back.
_terminal_artifact_pathsthen reads the path as neither terminal norheaded, forever.
raw_sessions,blob_refs,history_sidecars,raw_artifactsorsource_itemsrow: bytes consumed, nothing retained, and no route able tore-read them.
Solution
Origin.GEMINI_CLI_SESSIONdeclaresfrontier_kind = "whole-snapshot", anew value on the existing source-level continuation law meaning successive
observations are competing complete snapshots rather than continuations.
Admission routes such an origin through the same typed membership authority
browser captures already use, which yields one accepted head and a typed
decision for the rest.
DEFERRED_CAS_FRONTIERfailure evidence and defers, instead of droppingthrough and leaving an untyped quarantined raw.
_needs_work_from_state_uncorroboratedreports the fresh attempt withoutclearing
excluded. The quarantine is lifted by the cursor write of aningest that actually retained something, so a path that fails again stays
quarantined and a never-admitted path never presents a stale byte offset as
committed authority.
raw_artifactsupserts carry a shared guard(
terminal_carrier_overwrite_predicate) refusing an ordinary classificationthat would replace a terminal failure carrier; only failure-evidence writes
may change a carrier's kind.
_record_full_cursorrefuses to advance when the source tier holds no rowfor the path, recording retryable
raw_parse_recoverydebt instead. Theraw-id lookup it guards on was already being performed.
Deliberately not done: no gate exemption is widened, and the per-path drain
refusal owned by #4700 is untouched.
Verification
Fresh daemon on a scratch root over a frozen read-only copy of only the
gemini-cli and codex-state sources plus the three Claude JSONL files named in
polylogue-lqo6a (789 MB,
/realm/tmp/work/lane-raw-admission), productionroute
polylogued run:Before this branch the same pair produced two untyped quarantined raws, a
broken head, and repeated whole-backlog refusals.
devtools verify --quick— all 13 gates ok;render all --checkreportsnothing out of sync.
Residuals: one
source_raws_without_accepted_headgap remains for the secondfile of the pair. That is a gap, not a violation — the path is typed and
materializing it is what resolves it — and #4700 is what stops gaps from
blocking.
state_5.sqlitewas still awaitingfinalize_codex_state_snapshotswhen the rehearsal's time budget ended; that finalizer is unchanged here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid