refactor: shrink devtools and split archive query reads - #4060
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
…sition The reuse gate samples HEAD once at the top of run_gate and never re-checks it before committing to "reused". A concurrent HEAD move to a different commit with an identical tracked tree (amend, rebase --onto, another writer) is invisible to worktree_fingerprint, so reuse still fires against a receipt that no longer matches what is about to be pushed. This test simulates that transition by faking the second `git rev-parse HEAD` sample (currently absent) and asserts the gate falls back to a fresh quick verification instead of reusing. Currently fails: the gate reuses regardless.
…euse The reuse gate sampled HEAD once at the top of run_gate and never re-checked it before returning "reused". worktree_fingerprint diffs tracked content against HEAD, so it cannot distinguish "nothing changed" from "HEAD moved to a different commit with an identical tree" (amend, rebase --onto, a concurrent writer) — a receipt could be reused against a HEAD it no longer describes. run_gate now re-samples live HEAD immediately before committing to reuse and requires it still equal both the initially observed HEAD and every non-delete pushed local SHA, alongside the existing provenance (environment + worktree fingerprint) re-check. Added a comment making explicit that this is an opportunistic same-user performance optimization, not an authorization or attestation boundary — it should not grow into full re-verification or arbitrary-state fingerprinting. Ref polylogue receipt-reuse correctness review (independent review of 5b1396921, fix(devtools): harden pre-push receipt provenance).
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Delete the two modules after repository-wide reachability checks found no consumers. Remove their stale documentation references while retaining the live resume brief builder. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
The consolidated MCP read tools use the async admission context, so the previous blocking hook never observed a lease and made the synchronization assertion fail before exercising the route. Instrument the public async context and rendezvous in a worker thread after admission to preserve the concurrent lease assertion. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Replay continuity tests exercised the retired orphaned_blobs target after its accepted removal. Use superseded_raw_snapshots so the identity-remapping and retry contracts continue to enter the active maintenance catalog.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 466a0cab45
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| CommandSpec( | ||
| "workspace integrate", | ||
| "workspace", | ||
| "Apply an ordered list of lane commits to a clean linked integration worktree.", |
There was a problem hiding this comment.
Document the new integration command in AGENTS.md
Add devtools workspace integrate to the standalone AGENTS.md command list in this change. The new command is registered here and documented in docs/devtools.md, but a repository-wide search finds no corresponding AGENTS.md entry, so agents relying on the mandated standalone instructions will not discover or use it. The repository explicitly requires every devtools extension to be listed there in the same change.
AGENTS.md reference: AGENTS.md:L512-L513
Useful? React with 👍 / 👎.
| f"ancestry for source ref {source_ref!r} is ambiguous; target HEAD is not an ancestor; " | ||
| "provide explicit --commit SHA values" | ||
| ) | ||
| commits = _git(target, "rev-list", "--reverse", f"{target_head}..{source}") |
There was a problem hiding this comment.
Derive the commit range from the pinned source SHA
Use the already-resolved source SHA here instead of resolving source_ref again. In the parallel-lane scenario this command is designed for, a lane can advance its branch between _commit_sha()/merge-base and this rev-list; the new tip then bypasses the ancestry check performed against the old SHA, so commits from an unvalidated or divergent range can enter the integration plan. Passing f"{target_head}..{source}" keeps planning bound to the exact commit that was checked.
Useful? React with 👍 / 👎.
| """ | ||
|
|
||
| op_id = operation_id or str(uuid.uuid4()) | ||
| op_id = str(uuid.uuid4()) if operation_id is None else validate_operation_id(operation_id) |
There was a problem hiding this comment.
Translate invalid operation IDs at the public surfaces
Convert this new ValueError into each surface's typed invalid-argument response instead of allowing it to escape. For example, polylogue ops maintenance run --operation-id ../escape and run-preview reach this call through _run.py:162 without a catch; the similarly changed MaintenanceOperationRegistry.get_operation() is also called unchecked by _status.py:72 and the MCP status dispatcher at server_cutover.py:2037. Consequently ordinary hostile or mistyped user input now becomes an unexpected CLI/MCP exception rather than the structured error behavior already implemented for the daemon HTTP route.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Euo3GTawxdtdRgob9B5ke
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a10765947b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| -- value, even when this is the first producer-bearing | ||
| -- replay. A derived observation never overwrites producer | ||
| -- authority already stored on the session. | ||
| WHEN ? AND excluded.created_at_ms IS NOT NULL THEN excluded.created_at_ms |
There was a problem hiding this comment.
Keep timestamp intervals ordered on ordinary replacements
When a non-force, non-append replacement carries a producer created_at later than the currently stored updated_at—for example, after a provider corrects or misreports the creation time—this branch unconditionally advances created_at_ms, while the updated_at_ms CASE falls through to preserving the old value because both force_replace and merge_append are false. The resulting row has created_at_ms > updated_at_ms, despite normalization only guaranteeing that the incoming pair is ordered; clamp the retained update time to the selected creation time or only replace creation time when stored provenance is known to be derived.
Useful? React with 👍 / 👎.
| BATCH_LABELS = frozenset({CAMPAIGN_LABEL, "campaign-role:batch", "timing:execution"}) | ||
| # The migration commit is durable source evidence, not a roster embedded in this | ||
| # validator. The source loader below reads it through git without writing state. | ||
| CAMPAIGN_SOURCE_REF = "317b59f41f938884d289d48737cfe87ec00bd769:.beads/issues.jsonl" |
There was a problem hiding this comment.
Store the campaign anchor in the checkout
In a shallow checkout such as git clone --depth=1, this fixed ancestor object is absent, so _source_evidence() converts git show's failure into a campaign-source-anchor finding whenever the live export contains the campaign marker. The required devtools lab policy bead-graph --export .beads/issues.jsonl gate therefore exits 1 for an otherwise valid graph; keep the immutable evidence in a tracked file available at HEAD, or explicitly fetch the required object before validating it.
AGENTS.md reference: AGENTS.md:L345-L347
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd7b137520
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ), | ||
| semantic_reparse="no direct parser; retain unknown evidence until a concrete source adapter is admitted", | ||
| display_description="Unrecognized fallback exports", | ||
| public_filter=False, |
There was a problem hiding this comment.
Keep unknown-export available as a public origin filter
When an archive contains fallback sessions, this flag removes unknown-export from public_origin_tokens(), which now drives both DSL and parameter validation, so queries such as origin:unknown-export fail instead of returning those stored sessions. The repository defines unknown-export as a public query-origin token; keep it accepted by query validators even if completion visibility needs a separate policy.
AGENTS.md reference: AGENTS.md:L296-L300
Useful? React with 👍 / 👎.
Summary
Shrink duplicated developer tooling and split archive query reads on
feature/overhaul/integration-batch. This branch contains the accepted timestamp-authority and public-origin projection chains in addition to the earlier integration batch.Problem
The branch previously carried a self-contained PR carrier even though it includes work that overlaps open Beads. That made the GitHub summary weaker than the authoritative tracker and obscured which remaining work is intentionally outside this merge.
Solution
ArchiveStorewhile retaining the public delegates and row-type compatibility.OriginSpecacross CLI, DSL, MCP, and completion.Verification
Focused managed tests were run for the touched storage, query, devtools, replay, MCP, source, admission, timestamp, and origin surfaces. The exact branch head also passed
devtools verify --quick. These checks do not claim a complete-corpus run;devtools verify --allwas not run.Bead disposition
The branch is a coherent integration batch, but it does not claim completion of the native reindex campaign or unrelated open Beads. The current Beads export is the authority for those residual scopes.