Repository navigation
fix(storage): land 24 verified worker-6 Codex review fixes - #5800
Merged
Merged
Conversation
Drop the OPS identity refusal: open_initialized_tier_connection deliberately converges a same-version ops.db identity in place (initialize_archive_database documents that policy), so refusing it would strand every archive after an additive ops DDL change. Validate JSON materials as a stream rather than loading the whole document, return the persisted row on readmission without overwriting stored identity metadata, keep a pinned read from falling back to the live ops path, extend schema-enforcing source opens to the selected frontier admission helpers, and read the canonical tool outcome in the observed-event relation as well as the rollup. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
…n anchor The raw_frontier_blocked_source_paths except clause gained SchemaSkew, which moves its sqlite-degradation anchor digest; the site count is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Sinity
marked this pull request as ready for review
September 29, 2026 08:46
Sinity
enabled auto-merge (squash)
September 29, 2026 08:46
|
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 24 verified storage fixes from the worker-6 Codex-debt batch (beads polylogue-1tyq5.101, .102, .103). Each fix was rechecked against current master and has a regression test on its production route. One worker fix was dropped because it contradicts documented policy (103-09). The other 50 findings are recorded below as fixed-already, stale, refuted or not reached.
Problem
The worker could not run tests. Its draft (ca8dbff) was based on e1a2f75, and master has moved on since then. Each "fixed" claim therefore had to be checked again on current master. The defects that remain on master:
storage/materials.py)malformed.malformedtoo, because it is not a single JSON value.duplicate.Content-Lengthwas stored aspartial.Path.as_uri.storage/raw_retention.py)source.dbwithvalidate_schema=False. A source tier at an unadmitted schema version could then report healthy frontier evidence.ops.dbpath.event_id/summary.total_groups=0.unknown.list_embedding_catchup_runsrejected thecompleted_with_failuresstatus that its writer accepts.archive_tiers/bootstrap.py).bootstrapwas published, but before the format marker, left an archive that could not be recovered.Solution
Most fixes are the worker's patch, with these changes:
ijson.basic_parse, so a large material is never loaded as Python objects. NDJSON is parsed line by line.None.raw_frontier_blocked_raw_ids,_raw_frontier_blocked_selected_pathsandraw_frontier_blocked_source_pathsopensource.dbwith schema admission and reportSchemaSkewas unavailable.result_stateon master. The same defect is fixed in the two remaining readers: the rollup andrun_projection_relations(projection and pushdown).Verification
agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w6 -- <28 files>(job 2539): 631 passed, 12 failed, 1 error. The same 9 failures and 1 error occur on base (job 2601:test_user_state_contractsFacadeDaemonRequiredError x7,test_session_partition_convergencex2,test_frontier_admission::test_changed_keys_beyond_one_batch_are_all_checkedtimeout). The other 3 were test defects in the new file (DSLAND, source-tier raw lookup), fixed and rerun in job 2603: 43 passed, 1 failed (the same base timeout).ValueError: relative paths can't be expressed as file URIs,DID NOT RAISE,KeyError: 'uncompressed_bytes', and assertion failures).agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w6(job 2639):verify: PASSED exit=0at 2fcacb6 (the first run, job 2559, failed on a moved sqlite-degradation anchor; the anchor was updated in the baseline).Self-review
Sibling sites. Each defect class was searched across the codebase.
raw_retention.pywere fixed. The twoops.dbopens keepvalidate_schema=False, because OPS is a disposable tier whose identity converges in place.archive.pystill has error-count columns that count error signals; they make no success claim, so they were left unchanged.archive/actions/parsing.pyandrendering/semantic_cards.pyare presentation-layer and out of scope.save_viewanddelete_view.Cancellation and shutdown. No loops or long-running work were added.
Unbounded reads. JSON validation now streams rather than materializing a whole document. The ZIP manifest no longer copies names.
admit_material_filestill reads the whole file (103-13, not reached).Fail-open fallbacks. Removed rather than added: the pinned read no longer falls back to the live ops path. Schema skew now blocks admission instead of passing silently.
Compatibility shims. None added.
Removed symbols. The unused
require_operation_lifecycle_statusimport is gone. No monkeypatch targets or fakes reference anything removed.Tests prove the production route. Every test goes through
admit_material/acquire_material,ArchiveStore,initialize_active_archive_root, the trigger DDL, or the query route (query_unit_counts). The revert run shows they fail on master's code.Per-finding table
polylogue/storage/index_generation.py:1599polylogue/daemon/cli.py:3376: Shutdown discard is submitted through write_coordinator.run_sync before coordinator drain.polylogue/storage/materials.py:73polylogue/storage/materials.py:80polylogue/storage/materials.py:139polylogue/storage/materials.py:150polylogue/storage/materials.py:236polylogue/storage/materials.py:662-674; polylogue/storage/materials.py:715-720: List extracts IDs from tuple rows or sqlite3.Row; get_material maps cursor.description for tuples.polylogue/storage/materials.py:240polylogue/storage/materials.py:240polylogue/storage/materials.py:262polylogue/storage/materials.py:315polylogue/storage/materials.py:345polylogue/storage/materials.py:345polylogue/storage/materials.py:347polylogue/storage/materials.py:591-594: Local material admission reads the entire file into memory.polylogue/storage/materials.py:741polylogue/storage/materials.py:739-752: Timestamp/hash keyset cursor can miss subsequent inserts sorting before the cursor at the same timestamp.polylogue/storage/raw_authority_verdict_projection.py:103polylogue/storage/raw_authority_verdict_projection.py:86-148: Projection promotes every byte-proven append leaf independently of accepted-chain ambiguity.polylogue/storage/raw_failure_lifecycle.py:111polylogue/storage/raw_failure_lifecycle.py:124-139: Ordinary source open performs admission and reports SchemaSkewError as unavailable.polylogue/storage/raw_reconciler.py:213polylogue/storage/raw_reconciler.py:108-127: Renamed pass_id payload still advertises the previous census.v1 schema.polylogue/storage/raw_reconciler.py:324polylogue/storage/raw_reconciler.py:314-381: Explicitly requires an archive predating the raw-ID change; current assignment is fresh v1 with no carry-forward of that state.polylogue/storage/raw_reconciler.py:549polylogue/storage/raw_reconciler.py:564-615: Requests migration of durable candidate assertions from a deleted framework; outside the fresh-v1/no-carry-forward contract.polylogue/storage/raw_reconciler.py:1049polylogue/storage/raw_reconciler.py:394-473: Blocker ID selection only searches its proposed ID; a unique open plan conflict can suppress the insert while returning a nonexistent ID.polylogue/storage/raw_retention.py:1231polylogue/storage/raw_retention.py:1302polylogue/storage/raw_retention.py:1387-1420: Admission attributes a sampled million-row projection without refusing truncated populations.polylogue/storage/raw_retention.py:1688polylogue/storage/raw_retention.py:2350polylogue/storage/raw_retention.py:2478-2491: Residual test uses post-filter candidate count, which cannot prove the SQL selection was exhausted.polylogue/storage/search_providers/sqlite_vec_runtime.py:98polylogue/storage/search_providers/sqlite_vec_runtime.py:239-249: Managed provider rejects missing active index before attempting attachment; pinned snapshot uses read-only attachment at 120-133.polylogue/storage/search_providers/sqlite_vec_runtime.py:115polylogue/storage/search_providers/sqlite_vec_runtime.py:34-108;251-256: Managed connections rebuild and hash the complete eligible-message TEMP projection on each acquisition.polylogue/storage/source_generation_receipts.py:252polylogue/operations/daemon_ingest.py:881-999: Historical receipt serializes raw identities/completeness but not source-item blockers and member dispositions.polylogue/storage/sqlite/action_pairs.py:44polylogue/storage/sqlite/archive_tiers/__init__.py:43polylogue/storage/sqlite/archive_tiers/__init__.py:21-26;42-49: Exported durable tier constants and ARCHIVE_VERSION_BY_TIER all use version one.polylogue/storage/sqlite/archive_tiers/archive.py:416polylogue/mcp/archive_support.py:165-179; polylogue/surfaces/payloads.py:1311-1315: MCP delegates to canonical hydration and the shared summary envelope explicitly supplies terminal_state, total_cost_usd, cost_provenance and relative_time.polylogue/storage/sqlite/archive_tiers/archive.py:1085polylogue/storage/sqlite/archive_tiers/archive.py:1622-1629: Work-event append reverses public Origin into guessed Provider.polylogue/storage/sqlite/archive_tiers/archive.py:1086polylogue/storage/sqlite/archive_tiers/archive.py:2459polylogue/storage/sqlite/archive_tiers/archive.py:4492-4513: Named list_session_work_event_insights LIKE implementation is gone; current insight dispatch is elsewhere. No claim of testing successor search.polylogue/storage/sqlite/archive_tiers/archive.py:2542polylogue/storage/sqlite/archive_tiers/archive.py:3168; polylogue/storage/sqlite/archive_tiers/archive.py:3952: Full catalog coverage sets cost_is_estimated=0, confusing completeness with monetary authority.polylogue/storage/sqlite/archive_tiers/archive.py:2681polylogue/storage/sqlite/archive_tiers/archive.py:3351-3360;3400-3419: Outer cohort dedup count is reused for raw-model breakdown and status classification.polylogue/storage/sqlite/archive_tiers/archive.py:2957polylogue/storage/sqlite/archive_tiers/archive.py:3280;3311;3351: Session populations use json_group_array and lossless _decode_session_id_set instead of comma splitting.polylogue/storage/sqlite/archive_tiers/archive.py:3380polylogue/storage/sqlite/archive_tiers/archive.py:3971;8398: Profile SELECT and domain mapper both carry input_content_hash.polylogue/storage/sqlite/archive_tiers/archive.py:5215polylogue/storage/sqlite/archive_tiers/archive.py:5284polylogue/storage/sqlite/archive_tiers/archive.py:6193polylogue/storage/sqlite/archive_tiers/archive.py:6222-6229: Provider usage readiness takes archive-global status counters, not the requested origin/time scope.polylogue/storage/sqlite/archive_tiers/archive.py:6195polylogue/storage/sqlite/archive_tiers/archive.py:6222-6229: Provider usage readiness hardcodes stale count zero and only compares row coverage.polylogue/storage/sqlite/archive_tiers/archive.py:6730polylogue/storage/sqlite/archive_tiers/archive.py:7688-7699: Display duration subtracts normalized session endpoints, including synthesized endpoints.polylogue/storage/sqlite/archive_tiers/archive.py:7271polylogue/storage/sqlite/archive_tiers/archive.py:8140-8146: Missing persisted provenance is labeled with current materializer version.polylogue/storage/sqlite/archive_tiers/archive.py:7408polylogue/storage/sqlite/archive_tiers/archive.py:7672-7679: All heuristic titles are suppressed, not only prompt echoes.polylogue/storage/sqlite/archive_tiers/archive.py:7539polylogue/storage/sqlite/archive_tiers/archive.py:8454-8504: Former profile-cost fallback was removed; current cost insight uses canonical usage authority and reports no_tokens explicitly rather than labeling fallback as catalog-priced.polylogue/storage/sqlite/archive_tiers/archive.py:7839polylogue/storage/sqlite/archive_tiers/archive_plan.py:189polylogue/storage/sqlite/archive_tiers/archive_plan.py:181-213: Schema fingerprint and version readers now use canonical open_readonly_connection URI construction.polylogue/storage/sqlite/archive_tiers/archive_plan.py:261polylogue/storage/sqlite/archive_tiers/archive_plan.py:181-223;bootstrap.py:877-924: initialize_archive_tier_files_from_plan is deleted; ordinary fresh root bootstrap now records and admits pending intent.polylogue/storage/sqlite/archive_tiers/archive_query_reads.py:3424polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:48polylogue/storage/sqlite/archive_tiers/vocabulary_inventory.py:138-153: core_types is scanned before consumer re-exports, retaining declaration ownership.polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:49docs/atlas/00-core.md:59-67;docs/atlas/storage.md:35-40: Identity anchors no longer point at their generated-key declarations.polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:729polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:885polylogue/maintenance/archive_verification.py:1443-1467: Lineage sanity checks message existence but not branch-point content address agreement.polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:1217docs/atlas/storage.md:79-87: Session-link/branch-point explanation anchors shifted away from their declarations.polylogue/storage/sqlite/archive_tiers/bootstrap.py:249polylogue/storage/sqlite/archive_tiers/bootstrap.py:435-451;501-561: OPS sentinel fast path neither recreates nor refuses missing canonical objects.polylogue/storage/sqlite/archive_tiers/bootstrap.py:249polylogue/storage/sqlite/archive_tiers/bootstrap.py:254polylogue/storage/sqlite/archive_tiers/bootstrap.py:407-417: Derived identity stamp is followed by conn.commit().polylogue/storage/sqlite/archive_tiers/bootstrap.py:845polylogue/storage/sqlite/archive_tiers/bootstrap.py:1159-1178: Stored user_version is admitted before materialization; skew raises SchemaSkew.polylogue/storage/sqlite/archive_tiers/bootstrap.py:846initialize_archive_database); worker's refusal revertedpolylogue/storage/sqlite/archive_tiers/bootstrap.py:848polylogue/storage/sqlite/archive_tiers/bootstrap.py:877-905: Pending fresh bootstrap intent is validated and exempts incomplete first creation from completed-marker admission.polylogue/storage/sqlite/archive_tiers/bootstrap.py:883polylogue/storage/sqlite/archive_tiers/bootstrap.py:888-920: Marker admission and fresh-bootstrap classification are keyed to durable tier files, not replaceable-only tiers.polylogue/storage/sqlite/archive_tiers/bootstrap.py:959polylogue/storage/sqlite/archive_tiers/embeddings.py:20polylogue/storage/sqlite/archive_tiers/embeddings.py:7;26-31: Finding requires opening the pre-v1 version-five vector table; this assignment starts fresh with embeddings version one and canonical model column, no prior archives.polylogue/storage/sqlite/archive_tiers/index.py:868polylogue/storage/sqlite/archive_tiers/archive_query_reads.py:121-143;1066-1088: Public action row and selected column list omit canonical unknown-outcome reason.polylogue/storage/sqlite/archive_tiers/index.py:877polylogue/storage/sqlite/archive_tiers/index.py:1090polylogue/storage/sqlite/archive_tiers/index.py:1319-1320: Thread search projection only includes thread ID, repo and session IDs; evidence-kind/support terms are absent.polylogue/storage/sqlite/archive_tiers/index.py:1257tests/infra/reindex_differential.py:95-98: session_usage_rollup_bindings now has an explicit exact deterministic census classification.polylogue/storage/sqlite/archive_tiers/index.py:1499polylogue/storage/sqlite/archive_tiers/index.py:1786polylogue/storage/sqlite/archive_tiers/index.py:2150-2158: Child monetary amount may use provider evidence while its estimated flag is derived from catalog coverage.polylogue/storage/sqlite/archive_tiers/index.py:1919polylogue/storage/sqlite/archive_tiers/index.py:2289: Tag-rollup materialized_at is literal query-time rather than an ISO timestamp or missing value.polylogue/storage/sqlite/archive_tiers/ops.py:209polylogue/storage/sqlite/archive_tiers/ops.py:1-220;bootstrap.py:888-909: Finding asks to carry and drop objects in archives from the prior OPS schema. Fresh-v1/no-prior-state assignment excludes that upgrade.polylogue/storage/sqlite/archive_tiers/ops_write.py:1237polylogue/storage/sqlite/archive_tiers/read_insights.py:28polylogue/storage/sqlite/archive_tiers/read_insights.py:27-36: Date-window parser delegates to shared parse_query_date.polylogue/storage/sqlite/archive_tiers/read_insights.py:82polylogue/storage/sqlite/archive_tiers/read_insights.py:123-145: Episode context scans only physical session messages and misses composed inherited prefix.polylogue/storage/sqlite/archive_tiers/read_insights.py:83polylogue/storage/sqlite/archive_tiers/read_insights.py:115-136: LIMIT 3 is inside the row-producing subqueries consumed by GROUP_CONCAT.Derived-identity closure
All ten changed production files are members of the checked-in
docs/plans/schema-closure-baseline.json:storage/materials.py,storage/raw_retention.py,storage/sqlite/action_pairs.py,storage/sqlite/run_projection_relations.py, and instorage/sqlite/archive_tiers/:archive.py,archive_query_reads.py,archive_tiers_specs.py,bootstrap.py,index.py,ops_write.py.The index trigger DDL, the session timestamp projection and the action-pair lowering all change, so the derived identity moves. This must land before the fresh rebuild.
devtools schema closurecould not run in this checkout because its environment is not provisioned, so membership was read from the committed baseline.Residuals
created_at/updated_atstrings change format fromYYYY-MM-DD HH:MM:SSto ISO-8601...T...sssZ. No reader in this repository parses the old format;annotations/join.pyslices the first 10 characters, which is unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg