Repository navigation
fix(sources): harden acquisition routes against worker 9 findings - #5794
Merged
Merged
Conversation
Source fixes and authored regression cases for polylogue-1tyq5.90, .91 and .92. No tests, checks, builds or benchmarks run; verification and landing delegated to Claude.
…et tests The source-only ZIP stamp relied on declared_artifact_provider, which is ambiguous for any .json member because the OTel GenAI spec declares a catch-all .*\.json$ session rule, so the reported tool-results/dump.json case still stamped UNKNOWN. The project-key regression now drives the retained-UNKNOWN replay detector the finding names; the Drive cleanup test checks only for a leaked temporary, since the revision marker is dropped before publication by design. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
The asset walk's refusal logs moved with the no-follow rewrite, so the prose-logging ratchet counted them as new; emit them as one structured event with outcome and reason instead. Tests patch the owning modules rather than attributes the source modules do not export. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Sinity
force-pushed
the
fix/codex-debt-w9-sources
branch
from
September 29, 2026 04:52
d3047c3 to
edfab65
Compare
Sinity
marked this pull request as ready for review
September 29, 2026 04:53
Sinity
enabled auto-merge (squash)
September 29, 2026 04:53
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the verified part of ChatGPT worker 9's pass over Codex review findings in
polylogue/sources(beads polylogue-1tyq5.90, .91, .92; 75 findings). 13 fixes are kept, each with a regression test that fails on master. The other 62 are recorded below as fixed-already, stale, refuted or not reached.Problem
The findings are Codex P2 review threads on earlier PRs. The kept ones reproduce on current master:
source_pathwhen it reclassifies a Gemini CLI document, so a matching sidecar is skipped.nullJSONL records and large integers, and leaks its temporary file when a write or close fails.cursor_updateleaves a completed attempt withmaterialized_count=0..pbbytes.bytes.countfast path never runs.-shmbeside a symlinkedops.dbrather than beside its target.Solution
sources/assembly_chatgpt.py: the walk admits only lstat-regular files. Each asset is opened withO_NOFOLLOW|O_NONBLOCK, checked with fstat, then streamed withwrite_from_fileobj. Asset refusals are emitted as one structured event,sources.chatgpt.asset_refused.sources/revision_backfill.py:docs,prompt_templateandis_starter_projectadded to the probe's retained root keys.sources/dispatch.py:_lower_drive_like_payloadforwardssource_paththrough both recursive branches and the Gemini CLI spec.sources/drive/__init__.py: a successful decode is enough to validate a cache, and ijson runs in its lossless number mode. One cleanup path covers temporary creation, write, close and replace.sources/import_preflight.py: any caveat now reports DEGRADED, which is still admissible. The bounded-trajectory test expectation changes to match.sources/live/batch.py: the completed progress update carriesmaterialized_count. Source-only intake skips the language-server cohort, so.pbfiles take the ordinary raw snapshot.sources/live/batch_support.py: the regex no longer treats the empty line after a final newline as blank.sources/live/cold_build.py: the holder resolvesops.dbbefore deriving-shm. A sealed count at or above its denominator returns ETA 0.sources/live/hook_paste_enrichment.py: the lease check uses the configured archive root.Worker changes not landed:
census_parse_stage.pyidle-wait fix: the module has no production instance and polylogue-rykzt retires it. The liveLiveParseStagehas no such event pair.parse_prefetch.pycohort scoping: already on master through perf(sources): overlap parsing, decode once, never abandon preparation #5691 (_prepare_existing_session_writes(paths=...))..*\.json$rule, sodeclared_artifact_providerreturns None for every.jsonmember,tool-results/dump.jsonincluded.docs(review)commit: per-finding records belong in this body, not in tracked files.Verification
agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w9 --wait→ job 2346:verify: PASSED exit=0 ... head=edfab65f2749agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w9 --wait -- tests/unit/sources/test_codex_debt_w9_regressions.py tests/unit/sources/test_import_preflight.py tests/unit/sources/test_drive_source_client.py tests/unit/sources/test_live_batch_support.py tests/unit/sources/test_cold_build_generation.py tests/unit/sources/test_cold_build_durability_policy.py tests/unit/sources/test_revision_backfill.py tests/unit/sources/test_dispatch_payloads.py→ job 2347:passed 470, failed 1, total 471at head edfab65. The one failure,test_import_preflight.py::test_unidentified_trajectory_rows_keep_distinct_identities(aLogicalExportErrorfromparse_trajectory_db), fails the same way on unmodified master (jobs 2284 and 2348).test_codex_debt_w9_regressions.pywas copied into a worktree at unmodified master and run as job 2348, with 17 failures (17 failed in 21.74s). That covers every kept finding's test. The 92-13 ETA test fails only on its complete-count case; its two control cases pass on both heads, as intended.Self-review
_lower_drive_like_payloadhas one caller and_enrich_archive_paste_from_hookshas one. The cache-validator change covers both Drive routes (byte and streamed). Other-shm/-walderivations elsewhere in the daemon are outside this finding and are listed as a residual. The 92-01 gap is shared by the ordinary live ZIP route andretained_acquisition.py, which is why the one-route stamp was dropped rather than landed.continueonOSError.write_from_fileobjunder the existingMAX_UNCOMPRESSED_SIZEcheck. The Drive validators keep their streaming form..pbintake retains raw bytes without parsing, and parsing still needs the language server once derived tiers return. There is no alias or dual path.local_agent,tempfileandtimedirectly rather than through attributes the source modules do not export.parse_payload,iter_drive_raw_data,preflight_import_source,LiveBatchProcessor.ingest_files/_ingest_full_paths_sync,jsonl_complete_prefix,_hold_ops_checkpoints,enrich_paste_from_hooksand the retained-UNKNOWN detector_detect_unknown_retained_provider, which is the same private entry pointtest_revision_backfill.pyalready uses. The ETA test calls theaccepted_progressproperty on a hand-set generation.Per-finding dispositions
Counts: 13 fixed, 0 dropped as not real, 22 fixed-already, 3 stale, 2 refuted, 35 not reached.
Per bead: .90 6 fixed / 6 fixed-already / 2 stale / 1 refuted / 10 not reached. .91 3 / 5 / 1 / 1 / 15. .92 4 / 11 / 0 / 0 / 10.
sources/assembly_chatgpt.py: Regular-file lstat admission and no-follow/nonblocking opened-file validation prevent leaf-symlink and FIFO substitution from being acqu...test_w9_asset_acquisition_rejects_symlink_leavescensus_parse_stage.py, retired by polylogue-rykzt; liveLiveParseStagehas no such event pairsources/codex_state_evidence.py: The requested reconciliation depends on upgrading an earlier archive. This batch explicitly targets fresh v1 and forbids migrations/...sources/codex_state_evidence.py: Same-ID admission still needs an acquisition-state preservation proof; leave replay/storage reconciliation to follow-up.sources/codex_state_evidence.py: event_identity and its hook-event emission are gone; Codex thread state is now projected through codex_state_projection instead.sources/codex_state_evidence.py: State snapshot chunks are processed within the same writer ownership; no bounded writer-handoff implementation supplied.sources/codex_state_evidence.py: Backlog is fetched as a whole and consumed in one retained-receipt pass; replacing this needs end-to-end paging, not a cap.sources/codex_state_evidence.py: Replaying a shorter logical state value does not reconcile removed trailing chunk observations.sources/codex_state_evidence.py: The frame consumer still needs explicit cancelled/expired-read propagation instead of interpreting an empty projection as current.sources/cursor.py: ZIP skip accounting counts every physical member, unlike the declaration-aware acquisition population.sources/decoder_zip.py: Explicit suffix/predicate callers disable inferred declaration-path widening.sources/decoder_zip.py: Only strong artifact declarations widen the inferred member admission route.sources/decoder_zip.py: Unknown-inbox admission now uses cross-provider strong declarations; ordinary live ZIP acquisition retains their sidecars.sources/decoder_zip.py: Source-only ZIP admission supplies is_declared_artifact_path, so declared non-JSON sidecars are retained. Provider stamping is a separate fin...sources/dispatch.py: The bounded streaming document probe retains the three Claude project shape keys, without retaining their unbounded values.test_w9_retained_unknown_project_is_detected_beyond_prefixsources/dispatch.py: Drive lowering forwards source_path through recursive wrappers and the Gemini CLI document specification; all internal callers updated.test_w9_drive_lowering_preserves_gemini_source_pathsources/dispatch.py: Current master adds chatgpt_rejected_mapping_candidates; consumer-to-durable-accounting trace remains incomplete, so no resolution claimed.sources/dispatch.py: lower_chatgpt_documents now lowers shared decode records inside specs as well as the direct top-level case.sources/dispatch.py: Codex-task conservation exclusion still needs population-level treatment, not simply returning an empty document list.sources/dispatch.py: The production streamed generic caller normalizes ijson numbers before parse_generic_messages_stream; no additional dispatcher normalization is ...sources/dispatch.py: Shared-decode conservation and parser identity precedence require a joint production-route fix.sources/dispatch.py: DOM capture fallback IDs still require the same normalization as the production parser; old supported input is not automatically exempted by the...sources/drive/__init__.py: Both cache-reading and streamed revision-proof routes accept syntactically valid null JSONL records.test_w9_drive_cache_accepts_null_jsonlsources/drive/__init__.py: The finally cleanup covers tempfile write and close failures as well as rename failure, preserving the previous destination.test_w9_drive_failed_cache_publication_removes_temporarysources/drive/__init__.py: Lossless ijson number parsing prevents repeated downloads of Python-JSON-readable large integers.test_w9_drive_unchanged_large_integer_cache_does_not_downloadsources/hook_producer.py: Alternate-producer/compaction quiescence needs a complete writer-protocol trace; no fix or dismissal claimed.sources/hooks.py: Legacy-root source identifiers remain positional; no interface replacement/consumer update supplied.sources/import_preflight.py: Supported inputs with degradation caveats report DEGRADED. The existing bounded-trajectory test expectation is updated to the same hones...test_w9_trajectory_preflight_reports_degraded_stepssources/live/admission.py: The unreachable terminal branch cited by the review has been removed; current policy reacquires non-accepted receipts.sources/live/append_ingest.py: Asserted hook-carrier baseline versus byte-proven resynthesis needs a coordinated authority-proof change.sources/live/append_ingest.py: Success artifact observation still precedes single-session/chain-authority acceptance.sources/live/batch.py: Offered/default queued population is computed after blocking filters.sources/live/batch.py: Re-resolving historical blocked spellings can implicate a retargeted symlink destination; needs durable-identity handling.sources/live/batch.py: Direct deferred resynthesis is preserved, but deferred flush still re-reads an absent ops cursor; full deferred-plan regression not supplied.sources/live/batch.py: Deferred catch-up convergence still needs its own canonical receipt or duration attribution to the originating attempt.sources/live/batch.py: ingest_files catches escaped failures and finalizes the attempt, including writer-hold budget failures.sources/live/batch.py: Current byte accounting labels unattempted bytes, but that does not establish a per-file deferred/excluded disposition for an outer-loop time-...sources/live/batch.py: A structural halt still marks subsequent unattempted source groups as failed rather than refused/unattempted.sources/live/batch.py: Materialized sessions versus successfully parsed file units still needs all reader/telemetry consumers reviewed together.sources/live/batch.py: The completed progress event repeats the already-computed unique materialized-session count after best-effort cursor_update loss.test_w9_completed_ingest_repeats_materialized_countsources/live/batch.py: Live metrics now expose deferred_file_count, but typed catch-up receipt/CLI propagation is not fully established here.sources/live/batch.py: Source-only acquisition bypasses Antigravity language-server protobuf conversion and retains original bytes.test_w9_source_only_protobuf_does_not_invoke_convertersources/live/batch.py: This asks to migrate debts stored under predecessor subjects. Prior archive state is explicitly out of scope for fresh v1; current code emits ...sources/live/batch.py: Full file-backed JSONL acquisition computes and carries complete_prefix_size rather than requiring an in-memory raw payload.sources/live/batch.py: Boundary determination now checks the tail; an interior malformed line does not truncate the cursor before later accepted records.sources/live/batch.py: Snapshot scope selection for a renamed Antigravity SQLite store needs further current policy tracing; no fix or refutation claimed.sources/live/batch.py: Full hook-carrier raw bytes/frontier authority with a partial tail still needs coordinated baseline treatment.sources/live/batch.py: ZIP safety admission now precedes provider sniffing on the ordinary live route.sources/live/batch.py: Declaration-owned sidecars are excluded from ordinary ZIP provider sniffing.sources/live/batch.py: --explain still sniffs the whole infolist and retains provider_hint when constructing member classification; route equivalence remains open..*\.json$rule makesdeclared_artifact_providerambiguous for every.jsonmembersources/live/batch.py: Legacy promotion is now a deferred thunk, not an eager write during initial reconstruction. No legacy upgrade code added.sources/live/batch.py: Full-head reconstruction still requires the old full-file digest before composing a mutable-header Claude semantic frontier.sources/live/batch.py: Equal-metadata measurement-only update handling needs an accepted-change regression; no new fix supplied.sources/live/batch.py: Cursor publication compares the post-proof file observation with the pre-proof observation.sources/live/batch.py: Non-frontier prefix hashing charges cursor hash-read bytes.sources/live/batch.py: Publication rebases the accepted body end against the current Claude header length.sources/live/batch.py: The rebased publication_end is used for the cursor offset and corresponding file-length guard.sources/live/batch.py: Claude frontier read bytes are charged before rejecting an unavailable/invalid proof.sources/live/batch_support.py: The regex no longer treats the virtual empty EOF after a delimiter as a physical blank line; actual blank lines retain their existing ...test_w9_jsonl_boundary_keeps_newline_fast_pathsources/live/cold_build.py: Checkpoint-holder attachment checks the SHM file beside the resolved physical SQLite filename.test_w9_ops_holder_accepts_symlinked_databasesources/live/cold_build.py: A valid sealed complete count reports zero ETA after the advancement freshness window; incomplete and unsealed stale counts still report ...test_w9_completed_cold_build_eta_does_not_expiresources/live/cold_build.py: Projection refresh time, not receipt acceptance time, still renews the advancement clock.sources/live/cold_build.py: refresh_faulted_baseline calls _reset_accepted_progress(merged), then refresh_accepted_progress; the denominator and weights no longer re...sources/live/cursor.py: Completed-with-failures reader/metric label propagation needs all public consumers updated together.sources/live/dedup.py: Structural failure installs a per-source halt; the test autouse fixture only clears the global degraded flag.sources/live/hook_paste_enrichment.py: The enrichment route carries the configured archive root into its write-lease check instead of treating a generation index dir...test_w9_hook_paste_uses_archive_lease_for_generation_indexsources/live/metrics.py: LiveBatchMetrics.to_payload serializes both excluded_file_count and excluded_reasons.sources/live/parse_prefetch.py: Attempt cleanup exists, but retention of every unconsumed candidate/shard across warm cohorts is not fully resolved here.sources/live/parse_prefetch.py: Hashless worker errors remain reusable across changed source content; freshness/deferred disposition needs a full route fix._prepare_existing_session_writes(paths=...)scoped to current candidatessources/live/parse_prefetch.py: Per-path reconciliation opens concurrent read frames without establishing independent scan admission in this function.sources/live/production_baseline.py: Baseline.verify delegates to unretained_source_decisions/open_readonly_connection; the manually interpolated SQLite URI is gone.sources/live/production_baseline.py: Baseline emits its hashing phase before archive-member expansion and decomposition.Derived-identity closure
These changed files are members of
docs/plans/schema-closure-baseline.json, so the derived schema identity moves:sources/assembly_chatgpt.py,sources/dispatch.py,sources/drive/__init__.py,sources/live/batch.py,sources/live/batch_support.py,sources/live/cold_build.py,sources/live/hook_paste_enrichment.py,sources/revision_backfill.py.sources/import_preflight.pyis not a member. Membership was read from the committed baseline, not recomputed, because the bulk pool that runsdevtools schema closurejobs was paused. No module was added to the closure.Residuals
ops.dbis disposable. The finding stays open.-shm/-walpath derivations (daemon/status.py,daemon/health.py,daemon/backup.py, among others) do not resolve symlinks and were not reviewed here.test_unidentified_trajectory_rows_keep_distinct_identitiesalready fails on master.🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg