Repository navigation
feat(cli): route the last CLI writers through daemon operations - #5845
Merged
Merged
Conversation
Work in progress for polylogue-5vps8 / re6s3 / l65ry / 77tzg. 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. |
Sinity
enabled auto-merge (squash)
September 29, 2026 19:14
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
Moves the last CLI writers of durable and derived tiers behind declared daemon operations, deletes the hand-maintained CLI operation registry, and fixes four smaller defects on the same surfaces:
ops maintenance raw-authority-frontiernow submits a new declared operation,maintenance.raw-authority-frontier. Before this change it wroteraw_authority_blockersrows intosource.dbfrom the CLI process.demo verifyandops maintenance gc-historynow open read-only connections. Both used to open writable connections for a read.polylogue/cli/operation_bindings.pyis deleted, together with its registry test. The daemon-down matrix and the offline-writer test now take their routes from the CLI source itself.import --daemon-urlis deleted. The command accepted the value and then discarded it.polylogue ingestcommand and an--archive-rootoption, and neither exists.session_profileswriters have one insert shape. The column probes and the payload serializer for the nonexistentpayload_jsoncolumn are gone.analyze portfoliodecides one terminal outcome in every output format.Beads: polylogue-5vps8, polylogue-re6s3, polylogue-l65ry, polylogue-77tzg, polylogue-t4115 (portfolio half).
Problem
maintenance.offline_guard.refuse_writable_tier_opens). At 60c373b482 the sweep found:ops maintenance raw-authority-frontieropenedsource.dbwritable. The census it runs publishes durable blockers, and the only guard was the offline-maintenance residency check.demo verifyopenedindex.db,source.dbanduser.dbwith plainsqlite3.connect, which creates a tier file when it is missing.ops maintenance gc-historyopenedindex.dbwith a write profile.status,ops statusand theagentsviews openops.dbfor route telemetry. That route is filed as polylogue-k5iaf, because it belongs to the route-observability owner.CLI_OPERATION_BINDINGSwas a hand-maintained mirror that no production code read, yet it drove the daemon-down matrix's coverage test. The matrix exemptedmaintenance.blob-publications.abandonandmutation.raw-authority-blocker.resolveon the stated grounds that they need live ids. Both routes submit before they read anything.polylogue ingestto create the archive, or point --archive-root at an existing one". Following that advice fails again with "No such command 'ingest'".payload_jsoncolumn that the canonical DDL does not have, and then discarded it. It also probedPRAGMA table_infothrough a cache keyed byid(conn), which can go stale when a connection id is reused.analyze portfoliowrapped a truncated or partly unprofiled scope in a bare success with exit 0, and an empty scope also exited 0.Solution
maintenance.raw-authority-frontieris aWRITEoperation with fallbackNEVER. Its handlerdaemon_mutations.maintenance_raw_authority_frontierrunsinspect_raw_authority_frontierunder the daemon writer (run_write). The CLI renders the census the daemon returns.maintenance.raw_authority.inspect_frontier, the predecessor product function, is deleted. The docs and the archive-debt action text now say that running the command records the census.demo/verify.pyanddemo/constructs.pyopen throughopen_readonly_connectionandattach_readonly_database.read_gc_historyreads the GC ledger tier read-only and resolves that tier the same wayrun_blob_gc_reportdoes, through_gc_control_db_path.test_cli_operation_authority.pybuilds its coverage set from every declared mutating operation name that appears as a literal inpolylogue/cli.ops resettier branch (terminal format only, since that branch has no JSON envelope).maintenance.demo.augment, which is reachable only after a completed ingest, and the context-ledger receipt.tests/unit/cli/test_cli_lowering.py.polylogue/api/facade_clientandpolylogue/api/ingest, the facade's write routes. The CLI baseline stays empty.import --daemon-url. The option, its default helper and every test argv that passed it are gone. The integration test now asserts the socket the command really uses.core/errors.pyholds one guidance constant,FIRST_RUN_INDEX_GUIDANCE, used by both the storage open and the CLI pre-check. It namespolylogue init,polylogued run,polylogue import PATHandPOLYLOGUE_ARCHIVE_ROOT. A new test resolves each suggested command against the real Click groups.SESSION_PROFILE_INSERT_COLUMNSis the single insert shape, used by the sync writers and the async bulk writer. The probes, their caches,_fallback_profile_payload_json,_compose_bindingsand_with_fallback_payload_columnare deleted. The round-trip test now writes into the fresh canonical table.analysis.portfolio.portfolio_outcomenamesmatch_cap_exceeded,session_profile_unavailableandsession_digest_unavailable. The CLI attaches the outcome to the JSON result, prints the outcome line in the other formats, and exits throughoutcome_exit_code.find ... then delete --yesagainst a real daemon refuses with the empty-selection error and submits no delete operation.demo verifyandgc-historyopen no writable tier.Derived-identity closure. These changed files are members according to
docs/plans/schema-closure-baseline.json, and theschema-closuregate passes:polylogue/core/errors.py,polylogue/storage/blob_gc.py,polylogue/storage/derived/session/storage.py,polylogue/storage/sqlite/archive_tiers/archive.py,polylogue/storage/sqlite/queries/mappers_insight_profiles.pyandpolylogue/storage/sqlite/queries/session_insight_profile_writes.py. This PR moves the derived identity, so it should land before a rebuild starts.Deletion ledger (5vps8 AC12), from merge-base to head:
polylogue/cli/operation_bindings.py(369 lines),tests/unit/operations/test_cli_operation_binding_registry.py,maintenance.raw_authority.inspect_frontier,import --daemon-url, two column-probe helpers with their caches, and the fallback payload serializer.ops.dbtelemetry route in polylogue-k5iaf. The declared offline demo writers are excluded from both counts.Verification
agentctl job start --workspace <wt> polylogue verify_quickjob 3522 on 6758e81:succeeded; every gate passed, including layering, mypy and schema-closure.agentctl job start --workspace <wt> polylogue pytest_focused -- <39 files>job 3523 on 6758e81: 787 selected, 772 passed, 15 failed. Every one of the 15 also fails on master: the baseline runs are job 3505 at 87450e4 and job 3551 at 9e1924a (the two facets snapshot tests), and the dispatch namestest_empty_terminal_query_unit_is_an_explicit_outcomeandtest_every_verb_refuses_a_fresh_root_with_one_machine_envelopeas inherited. The earlier run on this branch (job 3485) failed on the GC-history ledger tier, the obsolete offline frontier refusal test and my zero-match test's expected exit code; all three are fixed in 58fbc48. Its demo and daemon-route timeouts did not recur in 3523, anddemo receiptsfinishes in 10 s outside the pool.user.dbwrite added tosubmit_cli_mutation's refusal branch turned 17 matrix rows red. This was an uncommitted experiment, not a candidate.--on-default-branch: these failures reproduce on master and belong to master-green:test_profile_mutation_census_matches_the_declared_ownerstest_archive_debt_*codex*(2)test_storage_one_shot_readers_cannot_mutate(2)test_demo_commandreceipt and tour teststest_empty_terminal_query_unit_is_an_explicit_outcometest_every_verb_refuses_a_fresh_root_with_one_machine_envelope(2)test_plain_cli_snapshotsfacets tests (2)ops.dbroute telemetry (status,ops status,agents status,agents work-item).Self-review
Last pass: pass 3, against
docs/review/codex-review-guide.mdand the generic worker-contract list. Pass 1 found the GC-history ledger regression and the obsolete offline-frontier test. Pass 2 found a private scratch path in a filed bead and scrubbed it. Pass 3 found nothing new.Review-guide checklist:
ops.dbtelemetry route in polylogue-k5iaf. The first-run text now has one owner,FIRST_RUN_INDEX_GUIDANCE, used by the storage open and the CLI pre-check. The remainingpolylogue ingestmentions inoperations/import_*docstrings are corrected. One remains insources/live/watcher.py, a closure file on the live intake route that I left to its owner. The column-probe class outside profiles is filed as polylogue-l91i8.mutation_refusalrenders them._gc_control_db_pathis shared withrun_blob_gc_report, so the report and the history view choose the same ledger tier; its probe uses the existing read-only helper.to_dict(sample_limit=100)). The frontier operation's 300 s client deadline matches the other maintenance operations; when a census runs past it the client reportsindeterminateand the daemon finishes the census. It is never reported as failure or rolled back.run_writeunder the daemon writer. A lost client cannot release writer ownership, and the census transaction is the storage owner's, unchanged.demo verifynow reports a missing tier asarchive unreadable, through its existingsqlite3.Errorbranch, instead of creating an empty file.read_gc_historystill raises on a missing ledger.outcome_exit_code. Postmortem stays undecided until fix: close 20 Codex P1 findings in sources, backup, browser, MCP #5835 provides its owner (see Residuals).has_content_hashwas true andhas_fallback_payloadfalse. The new test round-trips every payload through_row_to_session_profile_record.emptywith exit 2 (test). A zero-match delete refuses and submits nothing (test through a real daemon).operation_bindings(2 test consumers moved),inspect_frontier(1 test replaced),--daemon-urlon import (5 test argvs and the integration test),session_profile_insert_columns/table_has_column(2 production and 2 test consumers). No generated reference lists operations or import options (docs/cli-reference.mdcovers only top-level help).Generic list:
Residuals
mappers_insight_fallbackhydrators and the evidence/inference fallback inarchive.py) remain. About 18 test modules insert rawsession_profilesrows with'{}'payloads and rely on them, so removing the readers needs its own fixture sweep. The same class at other sites is filed as polylogue-l91i8.postmortem_outcome, which PR fix: close 20 Codex P1 findings in sources, backup, browser, MCP #5835 adds; that PR was still open when this one was opened.ops.dbin-process.indeterminatewhile the daemon finishes the census.mutation.facade.context_ledgerstays a best-effort receipt whose refusal the read views drop. It is exempt from the matrix, with the reason recorded there.🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg