Skip to content

fix: stream command-shape usage and preserve repository scope - #5992

Merged
Sinity merged 2 commits into
masterfrom
codex/command-shape-paging
Oct 5, 2026
Merged

Sinity merged 2 commits into
masterfrom
codex/command-shape-paging

Conversation

@Sinity

@Sinity Sinity commented Oct 5, 2026

Copy link
Copy Markdown
Owner

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; None remains 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 repo operand to the model's declared field, preserving repo precedence 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, receipt 20261005T032552Z-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, receipt 20261005T032603Z-quick-2091931-480d1e70. The exact-head pre-push hook also passed all 12 gates on 99e7770b71b19791a698077027536685bcdcf65e, receipt 20261005T033513Z-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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@Sinity
Sinity enabled auto-merge (squash) October 5, 2026 03:36
@Sinity
Sinity merged commit c4253b9 into master Oct 5, 2026
3 checks passed
@Sinity
Sinity deleted the codex/command-shape-paging branch October 5, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant