Skip to content

feat: pull request review folders and sessions for GitHub (increment 4a, ADR-0144) - #107

Merged
James-Chapman merged 18 commits into
mainfrom
dev/review-sessions
Dec 4, 2026
Merged

James-Chapman merged 18 commits into
mainfrom
dev/review-sessions

Conversation

@James-Chapman

@James-Chapman James-Chapman commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Increment 4a of the pull request review contract (docs/reviews.md, ADR-0144): review folders and review sessions for GitHub and GitHub Enterprise Server. The operator pastes a PR address into New Review; OMGCode itself (never the model) fetches the PR from the recorded review host into an isolated review folder and opens a review session. The model reads and lists the folder, writes only under scratch/, can fetch one more listed file, and can record draft comments. Nothing posts to a host and no posting call exists. No adapter has run against a real host: the GitHub adapter is tested against loopback fixtures only.

This is the first of two stacked PRs. Increment 4b (GitLab, Azure DevOps, Bitbucket; ADR-0145) follows on a branch from this one.

What changed

  • Core fetch. URL parser, fetch pipeline and GitHub adapter; the review folder <data>/reviews-v1/<id>/ with pr/ (holding base/, head/ and diff/), fetched/, scratch/ and review.json; sequential, bounded fetch (1,000 files, 1 MiB a version, 128 MiB, 6,000 requests) honouring rate-limit signals; every host path parsed as a portable relative path (case fold, reserved names, .git/.OMGCode, 256-byte limit) before anything is written.
  • Review workspace and sessions. A review is a workspace of its own kind with fixed preferences; the file layer admits writes under scratch/ only; ten tools (read, list, six file writes, review_fetch_file, review_draft_comment); no command, web, Git or AGENTS.md; the PR context message (at most 16 KiB) is recorded at start; five review.* journal events.
  • Closing. The closing record is written under the settings lock and checked at every turn start and tool dispatch; the turns end, then the folder is deleted, or the review stays closed with review_removal_incomplete and a retry. Removing a review host closes its reviews, cancels review starts in flight, and reports each review whose folder was left.
  • Desktop. New Review, a collapsible Reviews sidebar section, a review header with Remove review…, the PR context tab, review sessions offering only Files, Context and PR context; six new main commands (93 in total).
  • Docs. ADR-0144 (with an amendments section), docs/reviews.md (what is implemented, limits, known limits), docs/desktop-interface.md, docs/session-storage.md, docs/security-coding-rules.md, CHANGELOG.md. Version 0.92.0.
  • Fixes after a review of this increment (each has a test; the list is also in CHANGELOG.md):
    • The review header says "Partial: N of M changed files" and "Incomplete: K changed files without stored content" with counts by outcome, as the contract says.
    • A start whose progress read answered busy after the fetch had finished ended the dialog's wait and re-enabled Start review, so the same review could be fetched twice. The dialog now asks again (at most 30 times) and then says the review may have been created. The header and the PR context tab also show the loading line, not an error, while the journal is busy.
    • The PR context fences the description (each line starts with | , a line says where it ends), so a description cannot forge a field, its own end, or a file of the list.
    • review.json and pr/files.txt stay inside their 1 MiB limits: the fetch counts a record's largest size before it downloads the file, drops the notes of a record that no longer fits, and ends the list as partial when even that does not fit. review.json is written compactly.
    • The trusted CLI's review-host remove closes a host's reviews but deletes no folder (it cannot see a turn that the desktop runs); every review is reported review_removal_incomplete and the desktop's Remove review… finishes it.
    • Registering a workspace or granting a folder fails closed when the review folder root cannot be found.
    • review_fetch_file changes one ledger at a time (an exclusive lock, review_busy for a second call), counts a file stored before a failed ledger save instead of failing it for good, and removes its temporary file on a failed save. Removing a review removes the ledger, temporary file and lock; a start sweeps them for a closed review whose folder is gone.
    • A review folder counts as deleted only when nothing is left at its place, not when the deletion fails with a not-found error.
    • A start deletes the folder of a closed review a day after its last change, while it is still the folder the record names. A start that failed before it had a session, and could not delete its folder, left a closed review that no session could retry.
    • A path that the review text shows as an escape (U+061C, U+200E, U+200F, U+FEFF as well) can no longer be stored; one shared predicate and an exhaustive code-point test keep the two sets equal.
    • A request may have 48 path segments, so a 30-component path is no longer refused by the client.
    • A draft body with a bidirectional embedding, override or isolate is refused, and \r\n is accepted as \n.
    • A token replacement or host removal that is going to be refused cancels no start in flight.
    • Remove review… takes the settings-change flag after its confirmation, for the closing record only.
    • Two different versions of more than 50,000 lines each are not compared (too_large; both versions are stored), because the diff library cannot be cancelled. Debug timings only; release timings were not measured.
  • Findings of the review bot (22 threads). Fixed: the sweep above (a failed start's folder that no session could retry); pr/ keeps 1 MiB free for pr/files.txt; a start looks at a cancel once more before it records the review; a rate-limit reset time cannot overflow the wait; the host help text no longer says that removing a host always deletes the folders; the contract says the PR context is recorded when the review starts, that four adapters for six kinds remain, and three known limits (a deletion by name after the identity check, a failed-start record that cannot be closed, a token replacement that cancels without waiting). Pinned by a test: a rename, delete, or edit of a fetched file in pr/ is refused (the source of a rename was already checked). Not defects: the context move in review_info (the value is Copy), the start registered after its thread began (the table lock is held across both), GitHub's removed file status (GitHub documents removed, not deleted), the fragment check in the address parser (the fragment is cut first), and the spent single-use setup in the dialogs (Refresh models reads a new one).
  • Findings of the second bot re-review (9 new). Fixed: the review starts in flight are cancelled once a host's removal or a token replacement is recorded, not before (a change that core then refused had already cancelled them); a review folder root that does not exist yet refuses a directory that contains the folder it will be created in; the review header drops the pull request's title the moment an open review is shown as closed, also when the read of the closed review fails; the segment-limit refusal says 48. In the contract: review-host set-token closes no review, a cancel after the review is recorded ends no start, a failed start deletes its own folder by name without the record check, and a summary read begun just before a closing may return once more. Not defects, each now pinned by a test: a path of control characters is counted at its escaped size by the room budget, std::fs::rename replaces the ledger on Windows (a second distinct file is fetched and both are counted), and identical non-UTF-8 versions are refused as not_utf8 (an existing test already covered it). Documented, not changed: a fetch longer than the sweep's day, a folderless record, and the deletion by name.

Why it changed

PR text and files are the most direct prompt-injection route the product has, so the review path is built so that the model's reach is smaller than an ordinary workspace's: OMGCode makes every request, a token only ever goes to the host's recorded REST origin, paths are validated before they touch the disk, writes reach scratch/ only, and a closed review cannot dispatch another call. The fixes close the ways the first version let PR text act as the review's own text, overran a file limit after the downloads, or ran a deletion or a second fetch beside a running turn.

Tests

Updated:

  • Existing review, control, turn, desktop-wire, command-policy and layer tests for the new counts and shapes.

New:

  • Core: path rules (fold collisions, reserved names, over-long paths, the shared escape predicate over every code point), the fetch pipeline against loopback fixtures (outcomes, budgets, retries, cancel, collisions the volume reports, the record budget), the review tools (path escape, scratch-only writes, execute/Git/web denied, on-demand fetch ledger, the ledger lock, store-before-failed-save, bidirectional and CR LF draft bodies, a 30-component path), the description fence, closing (no dispatch after close, review_removal_incomplete, ledger files), the start sweep, the record cap, the compared-line limit, and the summary read.
  • App/desktop: start, progress, cancel, info, remove (flag taken after the dialog, a change during the dialog), shutdown with a start running, host removal and token replacement cancelling starts only when they will apply, the CLI removal deleting no folder, terminal_unavailable, review_closed listing.
  • UI (Vitest): New Review dialog (busy progress read, bounded retry), sidebar Reviews section, review header and PR context tab (partial and incomplete lines, busy), mock.
  • Checks run locally on Windows at e92d4b7, all passing: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (3,246 passed, 0 failed, 10 ignored), tsc, Biome, Vitest (1,404 tests), and test:dist. Not run locally: any Linux test (CI runs Linux; the Linux VM could not be reached), and the release-build timing of the diff limit (debug only). No adapter was run against a real host, and no review host was contacted.

🤖 Generated with Claude Code

James-Chapman and others added 11 commits December 4, 2026 01:21
A review workspace is its own control record with fixed preferences, a
scratch-only write rule at the file layer, and a closing record that stops
every later binding and dispatch. Session journals gain the review.* events.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eview into a folder

Pure parsers for the PR URL, repository paths and unified diffs, the
GitHub and GHES adapter with a paced request sender, the folder writer,
and the fetch pipeline with per-version outcomes and a manifest. Tested
against loopback fixtures only; no real host was contacted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…logic

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ions

A review session's turns now offer two more tools, run under the review
workspace's fixed rules, refuse once the review is closed, and check the
review record under the control lock at turn start and every dispatch.
Also applies cargo fmt to the earlier review commits.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… list a review's actions

start_review parses the address against the recorded hosts, fetches into a new
review folder, records the review workspace, and creates the session, removing
the folder and closing the record on any failure. Adds turn-level tests for the
fixed rules, scratch-only writes, the close, and the draft tool, and the
actions list --review filter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Closing a review ends its turns, deletes its folder only while it is still the
recorded directory, and leaves the folder for a retry when a turn does not end
in time. The host removal path now closes its reviews through the same steps.
Tool mode and skill loading resolve an open review's workspace.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds ADR-0144, the changelog entry, the review journal events in the session
storage guide, the review rules in the security coding rules, the review
session's tool list in the instructions guide, and an "Increment 4a as
implemented" section in the reviews contract that lists where the
implementation differs from it. The delivery list now splits increment 4 into
4a (GitHub and GitHub Enterprise Server) and 4b (the other adapters).

AGENTS.md swaps three long ADR link targets for plain ids to stay under the
32 KiB project-instructions cap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…iew's summary

Core and platform changes behind the review desktop (ADR-0144):

- A host path is compared after a per-character simple uppercase and then
  lowercase fold, for `.git`, `.OMGCode` and the device names too (COM0 to
  COM9, LPT0 to LPT9). A name that the volume already holds, or that needs a
  directory where a file is, is an `unportable_path` collision, not a failed
  fetch (`CreateError::is_name_conflict` in the platform crate). A failed
  review folder create removes the folder.
- A path over 256 bytes is unportable, including one given to the on-demand
  fetch tool, which refuses it before the host or the ledger is touched.
- A review start is refused up front once 1,024 review records exist.
- A review session refuses `workspace_git_read` with `git_read_disabled`.
- `review::summary` reads the title, author, and state of an open review from
  `review.json`, through the recorded folders and only while the manifest has
  the digest that `review.started` recorded.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds the Rust side of the review desktop (ADR-0144):

- Six `main` commands: `review_skills`, `review_start`, `review_progress`,
  `review_cancel`, `review_info`, and `review_remove`. A start runs on its own
  thread, at most two at once, and answers with an operation identifier. No
  command takes a host, a token, or a path, and every failure text is fixed.
- `session_tree` lists review sessions in a `reviews` list, each session
  carries `review` (`open`, `closed`, or null), `terminal_open` refuses a review
  session, and `workspace_entries` lists an open review's folder and refuses a
  closed one with `review_closed`.
- Removing a review host, or replacing its token, cancels every start in
  flight. A host removal reports each review whose folder was left, in the CLI
  and the desktop (`review_removal_incomplete`). Shutdown cancels starts and
  reports one that stays as `review_starts_still_running`.
- `review_info` reads the title, author, and state of an open review from
  `review.json` through core, and never from a journal.
- The command count is 93 (43 `main`, 3 `approvals`, 47 `settings`).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the main window

The UI side of the review desktop (ADR-0144). Every string from a host is a
text node: a link or image in a pull request stays inert text.

- **New Review** opens a dialog with the pull request address, a review skill,
  and the session's provider, model, and effort; it follows `review_progress`
  and can cancel.
- The sidebar lists review sessions in a collapsible **Reviews** section,
  apart from the workspace groups, and a closed review's row says so.
- A review session offers only Files, Context, and PR context. A header shows
  the pull request's title, author, and state and offers **Remove review...**
  with a retry when the folder was left; the transcript shows the `review.*`
  events as short text.
- The mock backend answers the six commands so the interface runs without
  Rust, and the settings help no longer says that creating a review is not
  available.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Records what increment 4a does and does not do (ADR-0144, docs/reviews.md):
the path and record limits, the known limits of the fetch, the desktop
commands and panels, the journal events, the closing rules, and that no
adapter has run against a real host and nothing posts. Bumps the workspace to
0.92.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 137 files, which is 37 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This organization's CodeRabbit subscription is cancelled. Resubscribe in Billing to continue reviews beyond the free-tier limit.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6dfeef9 and 22206f2.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 137

  • AGENTS.md
  • CHANGELOG.md
  • Cargo.toml
  • crates/omgcode-app/src/chat/skills.rs
  • crates/omgcode-app/src/desktop.rs
  • crates/omgcode-app/src/desktop/approvals.rs
  • crates/omgcode-app/src/desktop/chat.rs
  • crates/omgcode-app/src/desktop/error.rs
  • crates/omgcode-app/src/desktop/reviews.rs
  • crates/omgcode-app/src/desktop/reviews/tests.rs
  • crates/omgcode-app/src/desktop/session_setup.rs
  • crates/omgcode-app/src/desktop/sessions.rs
  • crates/omgcode-app/src/desktop/settings.rs
  • crates/omgcode-app/src/desktop/settings_review_hosts.rs
  • crates/omgcode-app/src/desktop/state.rs
  • crates/omgcode-app/src/desktop/terminal.rs
  • crates/omgcode-app/src/desktop/turns.rs
  • crates/omgcode-app/src/desktop/web_audit.rs
  • crates/omgcode-app/src/desktop/wire.rs
  • crates/omgcode-app/src/desktop/workspace_entries.rs
  • crates/omgcode-app/src/lib.rs
  • crates/omgcode-app/src/review_close.rs
  • crates/omgcode-app/src/review_close/tests.rs
  • crates/omgcode-app/src/review_host.rs
  • crates/omgcode-app/src/review_host/tests.rs
  • crates/omgcode-app/src/tool_mode.rs
  • crates/omgcode-app/tests/desktop_wire.rs
  • crates/omgcode-cli/src/actions_cli.rs
  • crates/omgcode-cli/src/review_host_cli.rs
  • crates/omgcode-cli/tests/actions_listing.rs
  • crates/omgcode-core/src/action_journal.rs
  • crates/omgcode-core/src/control.rs
  • crates/omgcode-core/src/control/credential.rs
  • crates/omgcode-core/src/control/folders.rs
  • crates/omgcode-core/src/control/review_host.rs
  • crates/omgcode-core/src/control/review_workspace.rs
  • crates/omgcode-core/src/control/review_workspace/tests.rs
  • crates/omgcode-core/src/files.rs
  • crates/omgcode-core/src/files/checkpoint.rs
  • crates/omgcode-core/src/lib.rs
  • crates/omgcode-core/src/review.rs
  • crates/omgcode-core/src/review/adapter.rs
  • crates/omgcode-core/src/review/adapters.rs
  • crates/omgcode-core/src/review/budget.rs
  • crates/omgcode-core/src/review/context.rs
  • crates/omgcode-core/src/review/diff.rs
  • crates/omgcode-core/src/review/diff_tests.rs
  • crates/omgcode-core/src/review/error.rs
  • crates/omgcode-core/src/review/fetch.rs
  • crates/omgcode-core/src/review/fetch_tests.rs
  • crates/omgcode-core/src/review/folder.rs
  • crates/omgcode-core/src/review/github.rs
  • crates/omgcode-core/src/review/github_tests.rs
  • crates/omgcode-core/src/review/model.rs
  • crates/omgcode-core/src/review/path.rs
  • crates/omgcode-core/src/review/path_tests.rs
  • crates/omgcode-core/src/review/start.rs
  • crates/omgcode-core/src/review/start_tests.rs
  • crates/omgcode-core/src/review/summary.rs
  • crates/omgcode-core/src/review/test_host.rs
  • crates/omgcode-core/src/review/tools.rs
  • crates/omgcode-core/src/review/tools_tests.rs
  • crates/omgcode-core/src/review/url.rs
  • crates/omgcode-core/src/review/url_tests.rs
  • crates/omgcode-core/src/review_host/client.rs
  • crates/omgcode-core/src/review_host/client/tests.rs
  • crates/omgcode-core/src/session.rs
  • crates/omgcode-core/src/session/inspection.rs
  • crates/omgcode-core/src/session/review.rs
  • crates/omgcode-core/src/turn.rs
  • crates/omgcode-core/src/turn/git_write_tool.rs
  • crates/omgcode-core/src/turn/granted_folder.rs
  • crates/omgcode-core/src/turn/review_session.rs
  • crates/omgcode-core/src/turn/review_session_tests.rs
  • crates/omgcode-core/src/turn/skill_dispatch_tests.rs
  • crates/omgcode-core/tests/review_session_events.rs
  • crates/omgcode-desktop/capabilities/main.json
  • crates/omgcode-desktop/src/command_names.rs
  • crates/omgcode-desktop/src/commands.rs
  • crates/omgcode-desktop/src/commands/reviews.rs
  • crates/omgcode-desktop/src/lib.rs
  • crates/omgcode-desktop/src/policy.rs
  • crates/omgcode-desktop/src/shutdown.rs
  • crates/omgcode-desktop/tests/layers.rs
  • crates/omgcode-desktop/ui/README.md
  • crates/omgcode-desktop/ui/src/ipc/client.ts
  • crates/omgcode-desktop/ui/src/ipc/errors.ts
  • crates/omgcode-desktop/ui/src/ipc/types.ts
  • crates/omgcode-desktop/ui/src/main/app.ts
  • crates/omgcode-desktop/ui/src/main/composer.ts
  • crates/omgcode-desktop/ui/src/main/context_tab.ts
  • crates/omgcode-desktop/ui/src/main/conversation.ts
  • crates/omgcode-desktop/ui/src/main/files_tab.ts
  • crates/omgcode-desktop/ui/src/main/model.ts
  • crates/omgcode-desktop/ui/src/main/new_review.ts
  • crates/omgcode-desktop/ui/src/main/new_session.ts
  • crates/omgcode-desktop/ui/src/main/pr_context_tab.ts
  • crates/omgcode-desktop/ui/src/main/review_entries.ts
  • crates/omgcode-desktop/ui/src/main/review_header.ts
  • crates/omgcode-desktop/ui/src/main/review_info_reader.ts
  • crates/omgcode-desktop/ui/src/main/setup_fields.ts
  • crates/omgcode-desktop/ui/src/main/side_panel.ts
  • crates/omgcode-desktop/ui/src/main/sidebar.ts
  • crates/omgcode-desktop/ui/src/main/status_footer.ts
  • crates/omgcode-desktop/ui/src/main/transcript.ts
  • crates/omgcode-desktop/ui/src/main/tree.ts
  • crates/omgcode-desktop/ui/src/mock/backend.ts
  • crates/omgcode-desktop/ui/src/mock/fixtures.ts
  • crates/omgcode-desktop/ui/src/mock/review.ts
  • crates/omgcode-desktop/ui/src/settings/review_hosts_section.ts
  • crates/omgcode-desktop/ui/src/settings/review_section.ts
  • crates/omgcode-desktop/ui/src/styles/main.css
  • crates/omgcode-desktop/ui/src/ui/dialog.ts
  • crates/omgcode-desktop/ui/src/ui/icons.ts
  • crates/omgcode-desktop/ui/src/ui/tabs.ts
  • crates/omgcode-desktop/ui/tests/dist.test.ts
  • crates/omgcode-desktop/ui/tests/helpers.ts
  • crates/omgcode-desktop/ui/tests/layout.test.ts
  • crates/omgcode-desktop/ui/tests/main_redesign.test.ts
  • crates/omgcode-desktop/ui/tests/mock_review.test.ts
  • crates/omgcode-desktop/ui/tests/panel_tab.test.ts
  • crates/omgcode-desktop/ui/tests/review_dialog.test.ts
  • crates/omgcode-desktop/ui/tests/review_info_state.test.ts
  • crates/omgcode-desktop/ui/tests/review_session.test.ts
  • crates/omgcode-desktop/ui/tests/review_sidebar.test.ts
  • crates/omgcode-desktop/ui/tests/settings_review_hosts.test.ts
  • crates/omgcode-desktop/ui/tests/side_panel.test.ts
  • crates/omgcode-desktop/ui/tests/ui_components.test.ts
  • crates/omgcode-platform/src/broker.rs
  • crates/omgcode-platform/src/broker/windows.rs
  • docs/adr/0144-fetch-reviews-from-github-into-isolated-review-folders-and-run-review-sessions.md
  • docs/adr/index.md
  • docs/agent-instructions.md
  • docs/desktop-interface.md
  • docs/reviews.md
  • docs/security-coding-rules.md
  • docs/session-storage.md

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@omg-review-bot

omg-review-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

⚠️ Re-review didn't finish on 22206f2

  • Started: 2026-12-04 05:50:49 UTC
  • Changes since: e92d4b7, the last review
  • Model: chatgpt
  • Review skill: code-change-review

It won't be retried until the next push, or until someone asks for a review in the bot.

@omg-review-bot omg-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated review of e7f43a6

Bot review number 1 of 30.

This PR adds GitHub pull-request review folders and isolated review sessions, including fetching, validation, bounded storage, session lifecycle handling, UI integration, and documentation. It is not safe to merge: multiple major lifecycle and concurrency defects can leave reviews or starts permanently stuck, publish cancelled or failed reviews, delete swapped or protected data, lose retry paths, or mishandle credentials and cleanup. Additional risks include GitHub deleted-file handling, retry-delay overflow, ledger and storage-budget failures, URL fragment rejection, post-close access, and several documentation/UI contract inconsistencies.

Findings: 🟠 14 × [P2] MAJOR · 🟡 7 × [P3] MINOR (Defect) · 🔵 2 × [P4] MINOR (Quality)

🛑 Changes requested: 21 unresolved finding(s) at [P3] MINOR (Defect) or above. I'll withdraw this once they're fixed or resolved.

Files not reviewed (1)
  • Cargo.lock (ignored by pattern)

Model chatgpt · skill code-change-review · 129 files reviewed. Reply to an inline comment to discuss it.

Comment thread crates/omgcode-core/src/files.rs Resolved
Comment thread crates/omgcode-app/src/review_host.rs Resolved
Comment thread docs/reviews.md Resolved
Comment thread docs/reviews.md Resolved
Comment thread docs/reviews.md Resolved
James-Chapman and others added 4 commits December 4, 2026 04:05
Sixteen findings of a review of the review folders and sessions, each with
a test (ADR-0144, Amendments):

- The review header says "Partial: N of M changed files" and "Incomplete:
  K changed files without stored content", and a busy journal shows the
  loading line, not an error.
- A start whose progress read answers busy no longer re-enables Start
  review, which could fetch the same review twice.
- The PR context fences the description so it cannot forge a field.
- review.json and pr/files.txt stay inside 1 MiB: the fetch counts the
  largest record of a file before it downloads the file.
- The trusted CLI's review-host remove deletes no review folder, because
  it cannot see the desktop's turns.
- Registering a workspace or granting a folder fails closed when the
  review folder root cannot be found.
- review_fetch_file changes one ledger at a time, counts a file stored
  before a failed ledger save, and removes its temporary file; removal and
  the start sweep clear the ledger files.
- A folder counts as deleted only when nothing is left at its place.
- A path the review text escapes can no longer be stored; one predicate
  and an exhaustive code-point test keep the sets equal.
- A request may have 48 path segments.
- A draft body with a bidirectional override or isolate is refused, and a
  carriage return and line feed pair is a line feed.
- A token change or host removal that will be refused cancels no start.
- Remove review takes the settings-change flag after its confirmation.
- Two different versions of more than 50,000 lines are not compared.

No adapter has run against a real host.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The review bot opened 22 threads on the previous head. Two were already
fixed by the previous commit, some read the code wrongly, and some are
documented limits. These held up and are fixed, each with a test where
one can reach it:

- pr/ keeps 1 MiB of its 128 MiB free for pr/files.txt, which is
  written after the versions.
- A start looks at a cancel once more before it records the review.
- A rate-limit reset time from a host cannot overflow the wait.
- The host help text no longer says that removing a host always deletes
  the folders.
- A test pins that a rename, a delete, and an edit of a fetched file in
  pr/ are refused.
- The contract says the PR context is recorded when the review starts,
  that four adapters (six kinds) remain, and three known limits.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A start that failed before it had a session, and could not delete its
folder, left a closed review record that no session could retry. The
orphan sweep skipped it because a record named it, so the fetched pull
request stayed on disk.

A start now deletes the folder of a closed review a day after its last
change, and only while it is still the folder the record names (the same
identity check a removal makes). Tests: an old recorded folder goes, a
young one stays, and a folder swapped for another directory stays.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…cked

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@omg-review-bot omg-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated re-review of af72aee

Bot review number 2 of 30.

New findings are only on code changed since the last review (e7f43a6); the rest was reviewed then.

This PR adds GitHub pull-request review folders and sessions, including isolated workspace handling, session metadata and ledgers, review tooling, desktop UI, lifecycle management, and updated documentation. The main risks are a manifest budget undercount for escaped unportable paths and ledger replacement failing on every second distinct fetch on Windows, both of which can break otherwise valid reviews. Additional issues include premature cancellation during host/token replacement, missing-root overlap checks, a non-UTF-8 diff validation gap, stale closed-review titles, inaccurate token-replacement documentation, and an outdated segment-limit error message.

Findings: 🟠 2 × [P2] MAJOR · 🟡 6 × [P3] MINOR (Defect) · 🔵 1 × [P4] MINOR (Quality)

🛑 Changes requested: 13 unresolved finding(s) at [P3] MINOR (Defect) or above. I'll withdraw this once they're fixed or resolved.

Files not reviewed (1)
  • Cargo.lock (ignored by pattern)

Model chatgpt · skill code-change-review · 136 files reviewed. Reply to an inline comment to discuss it.

Comment thread crates/omgcode-core/src/review/tools.rs Resolved
Comment thread crates/omgcode-core/src/review/diff.rs Resolved
Comment thread docs/reviews.md Resolved
Fixed:
- A host's removal or a token's replacement cancels the review starts in
  flight once the change is recorded (or may be), not before: a change that
  core then refused, such as a revision another writer moved, had already
  cancelled starts that it did not need to. The shared removal calls
  `host_unbound` on the caller's `ReviewTurns`.
- A review folder root that does not exist yet refuses a directory that
  contains the folder it will be created in, instead of passing it. A folder
  grant checks application storage first, so the data directory keeps the
  clearer `StorageOverlap` reason.
- The review header drops the pull request's title the moment an open review
  is shown as closed, also when the read of the closed review fails.
- The refusal for too many request path segments says 48, not 32.

Contract: `review-host set-token` closes no review; a cancel is looked at for
the last time just before the review is recorded and ends no start after it;
a start that fails deletes the folder it created by name, without the record
check; a summary read begun just before a closing may return once more.

Pinned by new tests, because findings were wrong about the code or the
behaviour was only implied: a path of control characters counts at its escaped
size in the room budget, a second distinct file replaces the ledger that the
first wrote, and a cancel from inside the session's preparation leaves the
review open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@omg-review-bot omg-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated re-review of e92d4b7

Bot review number 3 of 30.

New findings are only on code changed since the last review (af72aee); the rest was reviewed then.

This PR adds GitHub pull-request review folders and sessions, including review lifecycle management, isolation from normal workspaces, cancellation, UI state handling, expanded path limits, and related documentation/tests. The main risks are races during host removal or token replacement, where in-flight review starts may continue using credentials or writing to folders being deleted, and an isolation flaw that accepts ancestor directories before the review root exists. Cleanup is also aggregated across reviews, so one stuck review can prevent unrelated review folders from being removed.

Findings: 🟠 4 × [P2] MAJOR · 🟡 2 × [P3] MINOR (Defect)

🛑 Changes requested: 11 unresolved finding(s) at [P3] MINOR (Defect) or above. I'll withdraw this once they're fixed or resolved.

Files not reviewed (1)
  • Cargo.lock (ignored by pattern)

Model chatgpt · skill code-change-review · 137 files reviewed. Reply to an inline comment to discuss it.

Comment thread docs/desktop-interface.md Resolved
Comment thread docs/security-coding-rules.md Resolved
Comment thread crates/omgcode-app/src/review_close.rs Resolved
Comment thread docs/desktop-interface.md Resolved
James-Chapman and others added 2 commits December 4, 2026 05:31
Fixed:
- A host removal that closes several reviews judges the turns of each on
  their own. `ReviewTurns::stop` returns the reviews whose turns ended, not
  one flag for the batch, so a turn that does not end within 60 seconds leaves
  only its own review's folder. One flag left every folder in place, against
  the contract that a review that cannot be finished does not stop the others.
- The documents no longer say that a removal or a token replacement ends a
  review start. The start is asked to stop, a request already sent completes
  with the token it loaded, and the replaced token stays valid at the host
  until the operator revokes it there. They also say that a replacement whose
  journal write is uncertain cancels the starts and still reports the error.

Contract: a start writes nothing into the review folder after the review is
recorded (the files are written before), so a removal that deletes the folder
meets no writer, and the removal does not join the starts. A new test deletes
the folder from inside the session's preparation and checks that the start
finishes and that nothing brings the folder back.

Not changed: the finding that an ancestor of the review root is accepted before
the root exists is wrong about the code. A directory that holds the folder the
root will be created in, or any ancestor of it, is refused, and a sibling is
allowed, which an existing test pins.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… deletion

The test added for the third re-review deleted the review folder from inside
the session's preparation and asserted that the deletion worked. On Windows it
does not: the start keeps its own handle on the folder until it ends, so the
deletion fails, the removal reports `review_removal_incomplete` for that
review, and a retry deletes it. The test failed on the Windows filesystem job
and locally.

The test now pins what holds on both systems: after the record the start
writes nothing into the folder, so a folder that a removal deleted stays gone
and one that it could not delete is left exactly as the removal found it. The
contract says what happens on Windows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@James-Chapman
James-Chapman merged commit f9e03c6 into main Dec 4, 2026
19 checks passed
@James-Chapman
James-Chapman deleted the dev/review-sessions branch December 4, 2026 22:26
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