Repository navigation
fix: stream command-shape usage and preserve repository scope - #5992
Merged
Merged
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
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
Stream command-shape aggregation into disposable SQLite and preserve the requested repository across API, CLI and MCP reads.
Problem
Original polylogue-5gj19 42.F025 materialized every matching action before applying a small output page. 42.F026 returned repository A for a B-filtered session linked to both. MCP also omitted the filter because this registry model declares
repository.Solution
Keep the original shell normalizer and fold its streamed executions into an operation-owned temporary SQLite table. Count exact stage multiplicities and distinct sessions, then resolve the existing Python slice operands against the exact group count before passing finite bounds to SQLite. Negative and oversized integers keep their prior results;
Noneremains open-ended. The action cursor stays inside the caller's pinned snapshot; its checkpoint covers normalization and scratch SQL. Settle cursors, connection and temporary directory before returning, preserving primary and distinct cleanup failures.Filtered rows project the admitted repository. Unfiltered rows retain the existing alphabetical representative. MCP lowers its public
repooperand to the model's declared field, preservingrepoprecedence and refusing incompatible dual declarations. The existing scratch writer census records the disposable computation authority.Verification
agentctl job start polylogue pytest_focused --workspace /home/sinity/.codex/worktrees/attachment-coordinate-evidence/polylogue -- tests/unit/test_command_shapes.py tests/unit/analysis/test_command_shapes_contract.py tests/unit/storage/test_command_shape_paging.py tests/unit/storage/test_insight_read_snapshot_binding.py tests/unit/mcp/test_insight_projection_derivation.py tests/unit/core/test_insight_registry_runtime.py: job 9094 SUCCESS 0, 27/27 passed, receipt20261005T032552Z-focused-test-2091934-123e8d89. Scoped Ruff passed.agentctl job start polylogue verify_quick --workspace /home/sinity/.codex/worktrees/attachment-coordinate-evidence/polylogue: job 9095 SUCCESS 0, all 12 gates passed, receipt20261005T032603Z-quick-2091931-480d1e70. The exact-head pre-push hook also passed all 12 gates on99e7770b71b19791a698077027536685bcdcf65e, receipt20261005T033513Z-quick-2102297-2c1c303c; commit hooks passed. All nine committed path bytes match the managed test input capture. Both command_shapes.py and read_insights.py are IN the derived schema closure; land before reconvergence. No live rebuild was performed.Initial 9083: 20/21 passed; repository fixture supplied bare nonexistent directories, correctly excluded by canonical acquisition. The corrected fixture creates neutral discoverable Git roots. Initial 9084 identified the required scratch census entry and narrow typing corrections; original receipts retained. The next 9086 run passed every stored/API/MCP assertion and refused the CLI without its required resident daemon; corrected the harness to use the existing real UDS fixture. 9089 identified one test import typing issue, corrected without production changes.
Self-review
Reviewed the coherent delta against the affected read, snapshot, cancellation, cleanup, paging and public-interface contracts. One fold owns normalization and counts; all actual storage/API/CLI/MCP consumers retain their declared outputs. Tests exercise stored actions, A/B scoping, offset ordering, stage counts, zero timestamps, negative/oversized slice operands, streamed input and cancellation/cleanup exception identity. Scratch stays private and disposable; no durable schema, acquisition writer or paid vector changes.
Residuals
Each page scans its selected action relation; SQLite folding and sorting can use disk proportional to distinct session/shape pairs. Python memory retains one command and the requested result page; an explicitly unbounded output still retains its returned rows. The broader polylogue-5gj19 group remains open.