Skip to content

fix: keep result listings and latest working past one bad record - #105

Merged
youdie006 merged 2 commits into
mainfrom
fix/results-latest-untrusted
Nov 17, 2026
Merged

youdie006 merged 2 commits into
mainfrom
fix/results-latest-untrusted

Conversation

@youdie006

Copy link
Copy Markdown
Owner

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:

  1. One untrusted result broke latest and bridge_list_results. listFinalizedResultsReadOnly threw on the first result without a trusted task_completed receipt, so prodex results show latest, prodex results artifact latest and MCP bridge_list_results failed for every newer, trusted result. It is replaced by listResultsByTrustReadOnly() ({ trusted, untrusted }, receipts still read once). latest resolves to the newest trusted result, as pro latest does; with none trusted it gives the newest untrusted record's reason. bridge_list_results lists trusted results and, only when something was left out, adds untrusted_skipped and untrusted: [{task_id, status, summary}] (repo-relative paths, cwd redacted). Fetching or showing an untrusted result by id still refuses.
  2. pro blockers --cwd hid a repo with one corrupt record behind a bare catch {}: "No consults recorded in this repo." with rc=0. With --cwd the 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.
  3. sessions cancel <id> made the cancelled session the latest, because it went through writeSession, which stamps last_used_at. cancelSession now writes the record with its original last_used_at. Every other writeSession caller is a real send/preview/finish write and still moves a session to latest.
  4. --since 2026-02-30 was 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.ts now expects bridge_list_results to list around an untrusted record instead of rejecting, and tests/store.test.ts uses the new method.

Verification

  • Test-first: every new test failed on its assertion before its fix (8 new tests in 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 --noEmit clean; full suite 1944 passed, 3 skipped (subagent run); the five changed test files re-run by the main thread: 397 passed.
  • CLI repros re-run against the rebuilt dist with an isolated HOME; no browser or ChatGPT involved.
  • Not exercised: bridge_list_results over a real stdio/HTTP transport (handler-level only; the registration passes the result through asText unchanged).

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
@github-actions

Copy link
Copy Markdown

What this touches

  • bridge store
  • CLI
  • MCP
  • tests

12 file(s), 364 line(s) changed. Tests changed.

Worth a look

  • Careful read: touches the receipt/integrity path.

This is an automated first pass, not a review. CI is the gate; a person decides.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T00:05:03.605044Z 819ac65 PR opened
ℹ️ 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" or "@codex security review".

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
youdie006 merged commit 71c0935 into main Nov 17, 2026
7 checks passed
youdie006 added a commit that referenced this pull request Nov 17, 2026
fix: port main PRs #100 and #105-#109 to the container image
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
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