Repository navigation
fix: keep result listings and latest working past one bad record - #105
Merged
Merged
Conversation
Four ledger listing defects found by the 2026-11-09 bug hunt: - One untrusted older result failed `results show latest`, `results artifact latest` and MCP `bridge_list_results` for every trusted result beside it. The store now splits results into trusted and untrusted; `latest` resolves to the newest trusted one (as `pro latest` does) and `bridge_list_results` lists the trusted ones with `untrusted_skipped` and each untrusted record's reason. Fetching an untrusted result by id still refuses. - `pro blockers --cwd` turned one corrupt result record into "No consults recorded in this repo." with rc=0. With --cwd the record's error now fails the command; across all roots the bad root is named on stderr and the others are still reported. - `sessions cancel <id>` stamped last_used_at, so the cancelled session became "latest" and `sessions cancel latest` refused while a newer session was still running. Cancelling now keeps last_used_at. - `--since 2026-02-30` was read as 2026-03-02; impossible dates are refused. Verified: each new test failed on its assertion before its fix; tsc clean; full suite 1944 passed, 3 skipped (subagent run), and the five changed test files re-run here (397 passed). Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
What this touches
12 file(s), 364 line(s) changed. Tests changed. Worth a look
This is an automated first pass, not a review. CI is the gate; a person decides. |
Codex Review Summary: ✅ CompletedThis 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. |
…trusted # Conflicts: # CHANGELOG.md # src/store.ts
youdie006
added a commit
that referenced
this pull request
Nov 17, 2026
0.40.52 (51da80d, PRs #100 and #105-#109) published on its first publish run and is installed on WSL, M3 and the Mac mini; the MacBook M4 did not answer ssh and still runs 0.40.51. The browser containers on WSL and M3 were rebuilt twice: from 58650ce (container PR #110), which fixes the request_mismatch every container consult hit once ChatGPT keyed transcript units by turn id, and then from 9969a64 (container PR #111), which ports this release's fixes. Each swap was gated on the send lock, and a smoke consult answered with its request verified on both hosts after each. Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
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.
What changed
Four ledger listing defects from the 2026-11-09 bug hunt (against 0.40.50), each reproduced again on main 3b0bd6b before the fix:
latestandbridge_list_results.listFinalizedResultsReadOnlythrew on the first result without a trustedtask_completedreceipt, soprodex results show latest,prodex results artifact latestand MCPbridge_list_resultsfailed for every newer, trusted result. It is replaced bylistResultsByTrustReadOnly()({ trusted, untrusted }, receipts still read once).latestresolves to the newest trusted result, aspro latestdoes; with none trusted it gives the newest untrusted record's reason.bridge_list_resultslists trusted results and, only when something was left out, addsuntrusted_skippedanduntrusted: [{task_id, status, summary}](repo-relative paths, cwd redacted). Fetching or showing an untrusted result by id still refuses.pro blockers --cwdhid a repo with one corrupt record behind a barecatch {}: "No consults recorded in this repo." with rc=0. With--cwdthe record's own error now fails the command; across all roots, the bad root is named on stderr (blockers_warning: skipped ...) and the rest are reported.sessions cancel <id>made the cancelled session the latest, because it went throughwriteSession, which stampslast_used_at.cancelSessionnow writes the record with its originallast_used_at. Every otherwriteSessioncaller is a real send/preview/finish write and still moves a session to latest.--since 2026-02-30was read as 2026-03-02. Impossible calendar days are refused; leap days, dates with a time and ages (7d,24h) work as before.Two existing tests changed on purpose:
tests/mcp-tools.test.tsnow expectsbridge_list_resultsto list around an untrusted record instead of rejecting, andtests/store.test.tsuses the new method.Verification
tests/results-latest-untrusted.test.ts,tests/blocker-report.test.ts,tests/cli.test.ts); the src diff was also reversed and reapplied to watch them go red and green.npx tsc --noEmitclean; full suite 1944 passed, 3 skipped (subagent run); the five changed test files re-run by the main thread: 397 passed.bridge_list_resultsover a real stdio/HTTP transport (handler-level only; the registration passes the result throughasTextunchanged).