Repository navigation
fix(ingest): recover append kills; escalate stuck and silent failures - #5715
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c27787c08d
ℹ️ 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".
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfcb45fa89
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be22f38112
ℹ️ 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".
be22f38 to
6ffe238
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ffe23847e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 557670962c
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd270c461a
ℹ️ 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".
Squash of the reliability2 branch onto current master: worker-death attribution per held task with solo retries, revision-bound intake isolation and failure streaks, keyset and text-byte-bounded delegation pages, no-session accounting as a typed exclusion, derivation failure transience, and sanitized census validation logging. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
bd270c4 to
3bf67ed
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bf67ed3dd
ℹ️ 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".
A failed key's reason now leads with its phase and exception type, so the dispatcher's failure signature tells a KeyError from a TypeError in the same phase and alternating defects do not extend one exhaustion streak. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26dba7c242
ℹ️ 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".
The per-key inspection fallback classifies its exception and names its type in the reason. A worker that returns or raises alive ends its loss streak. index.db gains an expression index matching the query_delegations order, so a keyset page seeks instead of sorting a parent's cohort. The no-session attempt disposition now requires that every offered path was a no-session exclusion and that the time budget left nothing unattempted. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
#5691 rewrote the live parse stage around worker read-ahead, pool restarts, and preemption. The worker-death and hang handling from this branch is re-implemented on that model: per-file attribution by attempt markers, solo suspects, and escalation after repeated losses on an unchanged observation. The submission-time deadline reaper is replaced by a per-path no-progress hang bound that stops workers through the same pool restart that reaps read-ahead. daemon/cli.py takes master's _derivation_admission and keeps the failed outcome's transient flag. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
The adapter kept select_ingest_candidates beside the new classify_ingest_candidates, and LiveWatcher kept select as a wrapper. Classification is now the one selection route: the wrapper and the adapter's select branch are removed, and fakes, docs and the proof receipt name classify. A scheduled retry that is not yet due is covered by a watcher test and an adapter test (DEFERRED, never DUPLICATE). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
DelegationPageKey used `or`, so an empty-string instruction block id keyed on the child session id, a position the SQL COALESCE order never had. A pool break seen again after an unverified stop is no longer attributed a second time. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ity2 Master added a FAILED outcome at the post-publication requiredness recheck. Like every other exception-backed FAILED outcome in this branch, it now names the exception type first and carries transient=_is_transient_failure(exc), with a test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Recovers the tail of an append whose process was killed mid-write, and turns four kinds of stuck or silent ingest/daemon failure into terminal, visible outcomes. Beads: polylogue-b8of0, polylogue-7c5k6, polylogue-wyi9p, polylogue-oulj2, polylogue-hu24g, polylogue-xf8qp, polylogue-zt8is, plus two status residuals of polylogue-qw8zp / polylogue-10a3q.
Problem
DUPLICATE. Later passes defer forever, because the writer refuses a prepared field union ("no longer applies") that its own precedence decision no longer needs. The index stays at 3 of 6 messages.BrokenProcessPoolwas deferred, and a deferral resetsfailure_count, so a file that kills its worker is retried every pass for the whole build. A hung worker is stopped only at shutdown and holds its slot until then.RETRYABLE, and the attempt counter restarted after each cooldown. Asqlite3.Errorescaping page admission bypasseddaemon.intake.page_refused.0.0, which granted the whole monthly budget.discovery_pending/Nonewhile discovery paged. A root with no active generation had no status frame, so the snapshot read "unavailable" for the entire first build.Solution
watcher.classify_ingest_candidatessplits a page into paths that are needed now and paths that are waiting on a scheduled retry; it is the only selection route (select_ingest_candidatesis removed).FileIntakeAdapterreports a pending path asDEFERRED, neverDUPLICATE. The writer drops a prepared union its precedence does not need and writes the parsed rows it already holds.LiveParseStage(rebuilt on perf(sources): overlap parsing, decode once, never abandon preparation #5691's read-ahead model) charges each worker loss to the one file whose task a worker held._run_holding_attemptmarks the parent-assigned attempt directory when a worker takes a task and when it lets go, so the tasks held at a pool break are exactly those started and not finished. One held task is charged. Several are deferred uncharged and become solo suspects, which run on an otherwise idle pool (and are never read ahead) until a worker comes back from them, so each later loss names one file. Losses are counted per observation (size, mtime_ns, inode). The third consecutive loss on an unchanged observation is a non-deferred failure carryingfailed_observation, andpop_pathapplies it only to a capture of that same revision; the cursor's failure budget then quarantines the file._stop_process_workers, the same restart-and-settle path that reaps read-ahead. Only that path is charged; interrupted required siblings lose their restart deferral and the waiting warm resubmits them. Slow work that keeps writing is never stopped. The earlier submission-time deadline reaper, its_path_startedclock and the pluralfailed_attemptsrestart argument are gone.AdmissionResult.transientrecords whether a failure can clear on its own. Locks, OS errors and storage faults are transient and retry without bound. An unchanged item that repeats the same non-transient failure is isolated aftermax_deterministic_cooldowns(3). The page handler also catchessqlite3.Errorand emitspage_refused.Nonewhen unreadable, and the pass then refuses withspend_unmeasured.last_error), or narrows its handler (Gemini now catches onlyValidationError).EXCLUDED._status_framereturnsno-active-generationfor a missing active index.batch.pyhas not imported since fix: retain JSON evidence through size-independent preparation #5557.Schema identity:
devtools schema closuremarkssources/live/{batch,batch_support,metrics,parse_prefetch,watcher}.py,sources/dispatch.py,sources/codex_state_evidence.pyandstorage/sqlite/archive_tiers/write.pyIN, and the newidx_delegation_facts_query_orderchanges index DDL. This PR moves the derived identity (parse_prefetch.pyincluded), so it must land before the fresh rebuild starts.Verification
On head
dbccb4817b, through AgentCTL jobs (never in-process):agentctl job start polylogue verify_quick(jobc1c21522):verify: PASSED exit=0 ... head=dbccb4817b15agentctl job start polylogue pytest_focused -- <15 files: derivation kernel laws, parse-stage equivalence, live watcher, daemon cli, derivation admission, parse prefetch, watcher locking, prefetch cache, dispatcher intake measurement, fair intake, delegation materializer, page selection, batch convergence, excluded-cursor proof, canonical ingest>(jobf43837d3):580 passed, 3 failed. Four daemon-cli tests failed in the batch and passed on isolated rerun (host load; one of them, the cold-build transient settlement test, also passed alone on the previous head as2 passed in 47.56s).0156f3b97a(clean detached worktree,pytest_focused -- --on-default-branch:3 failed), so they are inherited, not caused here:test_live_batch_convergence::test_page_admission_runs_lease_free_owners_outside_the_writer_gate,test_live_watcher_locking::test_watcher_queues_behind_daemon_maintenance_writer,test_dispatcher_intake_measurement::test_dispatcher_page_compaction_cost_is_one_scoped_hold_at_archive_scale.New behavior tests, each naming what would make it fail:
DEFERRED(pre-fix:DUPLICATE), then 6/6/1 messages and no parse errors; a scheduled retry isDEFERREDwith zero cost at the adapter andpendingin watcher classificationIntegrityErrorpage emitspage_refusedEXCLUDEDCOALESCEdoesSelf-review
A full read of the PR diff against master after the merges. Each item says how it applied.
_warm_untilcheckscancelledon every poll, and the hang reaper runs inside that loop. It never waits itself: it stats attempt directories and restarts the pool. After_closing, pool-death attribution returns the shutdown deferral and does not restart the pool. After an unverified stop (_cleanup_blocked), it charges nothing. That second case fixes a finding: a later collection of the same break would otherwise have charged a sibling a second time.scandirper running required path per poll._path_worker_lossesand_path_solo_suspectsgrow only with distinct files that lost a worker. They are cleared when a worker comes back from a file, and they are not pruned for files that are never seen again (see Residuals)._release_slot. Collection, pool restart and thread-orphan reaping all use it. That removed the parallel_path_sizesand_path_starteddicts, each of which every release site had to remember. A streak ends at every site where a worker comes back from a file: a collected success, a collected exception, and a success the restart preserved. Two sibling defects were found and fixed.DelegationPageKey.after_rowusedor, so an empty-string block id keyed on the child session id, a position the SQLCOALESCEorder never has; it now coalesces NULL only, with a test.pop_path's changed-source branches were checked against fix(intake): one interpretation across live and retained routes #5643's_discard_retained_path. A failed result never carries retained members, so the newfailed_observationbranch needs no discard.requiredness inspection: {exc}). Like this branch's other exception-backed FAILED sites, it now names the exception type and carriestransient, with a test.select_ingest_candidatesas a fallback beside the newclassify_ingest_candidates, andLiveWatcher.select_ingest_candidateshad become a wrapper. Classification is now the only selection route. Fakes,docs/daemon.mdand the excluded-cursor proof receipt name it.warm_paths/pop_path. The worker helper is wrapped by the production_run_holding_attempt, so the markers are the production ones rather than test-written. The hang test runs a warm on a thread with a join bound, so a missing reaper fails instead of hanging. A slow worker whose attempt directory keeps growing proves the bound measures lack of progress, not time since submission. The scheduled-retry split had no test; it now has a watcher test (pending vs. settled exclusion) and an adapter test (DEFERRED,actual_cost0, neverDUPLICATE).Residuals
_path_worker_lossesand_path_solo_suspectsare cleared when a worker comes back from a file, but they are not pruned for a file that never returns. They are bounded by the distinct files that lost a worker during one daemon's life.A worker lost under a retained-member preparation (fix(intake): one interpretation across live and retained routes #5643 runs those on the same pool during reconciliation) restarts the pool without attribution, so such a loss is never charged. It errs toward under-charging, never toward a false charge.
7c5k6 "visible in status": escalation reaches the cursor quarantine through the writer's generic parse-failure path (
batch.pyper-recordexcept Exception→mark_raw_parse_failed). I confirmed this by reading the source; no end-to-end quarantine test drives a killer file through five cursor failures.The hu24g optional ratchet (a devtools pattern rule for broad excepts) is not included.
🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg