Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8649cff
feat: record review workspaces and review session events
James-Chapman Dec 4, 2026
32e16e6
feat: parse review URLs and paths, render diffs, and fetch a GitHub r…
James-Chapman Dec 4, 2026
9b0b33d
feat: add the PR context message and the review draft and fetch tool …
James-Chapman Dec 4, 2026
a70137e
feat: offer review_fetch_file and review_draft_comment in review sess…
James-Chapman Dec 4, 2026
745e1ad
feat: start a review end to end, test the review session runtime, and…
James-Chapman Dec 4, 2026
f6e7123
feat: finish a review's closing and let a review session chat
James-Chapman Dec 4, 2026
6629782
docs: record increment 4a of the pull request review contract (ADR-0144)
James-Chapman Dec 4, 2026
da9ec80
fix: fold path case like a volume, cap review records, and read a rev…
James-Chapman Dec 4, 2026
016bea5
feat: start, list, and remove reviews from the desktop
James-Chapman Dec 4, 2026
a17a4fd
feat: add New Review, the Reviews section, and the PR context tab to …
James-Chapman Dec 4, 2026
e7f43a6
docs: record increment 4a as implemented and release version 0.92.0
James-Chapman Dec 4, 2026
1f68cea
fix: close the defects a review of increment 4a found
James-Chapman Dec 4, 2026
5c1a009
fix: act on the review bot's findings that held up
James-Chapman Dec 4, 2026
4acf0f3
fix: sweep the folder of a closed review that no session can retry
James-Chapman Dec 4, 2026
af72aee
test: pin that nothing after a pull request address's fragment is che…
James-Chapman Dec 4, 2026
e92d4b7
fix: act on the second re-review of the review sessions
James-Chapman Dec 4, 2026
0e6ddec
fix: act on the third re-review of the review sessions
James-Chapman Dec 4, 2026
22206f2
fix: pin the review folder after the record by its contents, not by a…
James-Chapman Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ and one module writes the frontend's only style, a listed size property
A run of tool requests, results, and outputs is one narrower, darker card, closed until the
operator opens it, with a closed card inside for each call, and a tool-enabled
turn's timeout defaults to 1800 seconds and its calls to 1000
([ADR-0129](docs/adr/0129-raise-the-chat-budget-defaults-and-start-new-workspaces-with-model-tools-on.md),
[ADR-0112](docs/adr/0112-group-tool-calls-in-a-closed-card-and-default-the-turn-timeout-to-300-seconds.md),
[ADR-0116](docs/adr/0116-put-each-tool-call-and-its-output-in-its-own-card-inside-the-tool-card.md)).
(ADR-0129, ADR-0112, ADR-0116).
Session rows are one line with the time since the last update. The right-hand
panel's tabs: a Terminal that runs the operator's own shell in the session's
workspace folder, PowerShell on Windows and `$SHELL`, `bash`, or `sh` on Linux,
Expand All @@ -54,8 +52,7 @@ A reply is labelled with the model from its turn's request manifest and can be
copied as Markdown, as plain text, or as a PNG repainted on a canvas, through
the clipboard only, with icon buttons named in their tooltips
([ADR-0068](docs/adr/0068-name-replies-by-model-and-copy-them-as-markdown-text-or-image.md)).
Your prompt and each tool call card have the same three buttons
([ADR-0117](docs/adr/0117-copy-a-prompt-or-a-tool-call-as-markdown-text-or-an-image.md)).
Your prompt and each tool call card have the same three buttons (ADR-0117).
Chat offers the session's model read and list tools; when the workspace
also enables `read` and `write`, six file-write tools (exact edit, multi-edit,
create, rename, delete, and directory creation); and, when it also enables `execute`, `read`, and
Expand Down Expand Up @@ -126,9 +123,14 @@ model addressed a granted folder, and no native dialog was observed
([ADR-0118](docs/adr/0118-grant-a-workspace-access-to-folders-outside-it.md)).
No other model network tool and no MCP tool exists. The operator can record
review hosts, each with one token in protected OS storage, through the trusted
CLI `review-host` commands or the `settings` window. This only records
configuration: no fetch adapter, review folder, or review session exists and
nothing contacts a host (ADR-0143, [reviews](docs/reviews.md)). A read-only
CLI `review-host` commands or the `settings` window (ADR-0143). **New Review**
has core, never the model, fetch one GitHub or GitHub Enterprise Server PR into
an isolated review folder and opens a review session: read and list tools,
file writes under `scratch/` only, `review_fetch_file`, and
`review_draft_comment`, with no command, web, Git, or `AGENTS.md`, and nothing
runs once the review is closed. The other adapters, a drafts view, and posting
do not exist, and no real host was contacted
([reviews](docs/reviews.md), ADR-0144). A read-only
`workspace_git_read` tool (`status`, `diff`, `log`, `show`, `branches`) runs in
the hidden `omgcode git-worker`, never in the desktop process, in the
workspace sandbox: no network, tree limits, a 30-second deadline, and the
Expand Down
172 changes: 172 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,178 @@ Changes are recorded here before a release version is assigned.

### Added

- Version 0.92.0 implements increment 4a of the pull request review contract,
review folders and review sessions for GitHub and GitHub Enterprise Server
(ADR-0144). No adapter has run against a real host: the GitHub adapter is
tested against loopback fixtures only, and nothing here posts to a host.
- Core fetches a pull request through a recorded review host into an
isolated review folder, `reviews-v1/<id>/`, with `pr/description.md`,
`pr/files.txt`, `pr/tree.txt`, the base and head version of each changed
file, one diff per file, and `review.json`. Each file version has one
recorded outcome, and every host path is parsed as a portable relative path
before anything is written. The fetch is sequential and bounded (1,000
changed files, 1 MiB a version, 128 MiB, 6,000 requests) and honours the
host's rate-limit signals. Host kinds without an adapter are refused with
`review_host_kind_unsupported` before anything is created.
- A review is a workspace of its own kind with fixed preferences: read and
write allowed, execution, Git, web fetch, host services, and task
networking denied. The file layer admits a write only under `scratch/`.
A review never loads the folder's `AGENTS.md`.
- A review session offers ten tools: read, list, the six file-write tools,
`review_fetch_file`, and `review_draft_comment`. The fetch tool downloads one
listed path from the host into `fetched/` with core building the request,
within 500 calls and 64 MiB. The draft tool adds, replaces, or deletes a
draft in the session journal; an inline draft must name a line of the
file's stored diff. Neither posts anything, and no posting call exists.
- A review closes when the operator removes it, when its host is removed,
or when its host record changes. The closing record stops every later turn
start and tool dispatch (`review_closed`); then the review's turns end and the
folder is deleted, or the review stays closed with
`review_removal_incomplete` and a retry. Removing a review host closes its
reviews first.
- Session journals record `review.started`, `review.context`,
`review.draft_set`, `review.draft_deleted`, and `review.closed`.
`actions list --review <id>` lists one review's model actions.
- The desktop adds **New Review** beside **New session**, a **Reviews**
section in the session sidebar, and six `main` commands (`review_skills`,
`review_start`, `review_progress`, `review_cancel`, `review_info`, and
`review_remove`). A review session's right-hand panel offers **Files**,
**Context**, and **PR context**; its terminal is refused.
- Review paths and limits. A host path is compared after a case fold (each
character's simple uppercase form, then lowercase, as a volume that folds
case folds it), so two paths that fold alike are an `unportable_path`
collision, as are a `.git` or `.OMGCode` component and a device name
(`COM0` to `COM9`, `LPT0` to `LPT9`) whatever its case. A path over 256
bytes is unportable, including one asked of the fetch tool. An entry the
volume already holds under a name that differs only in a way the check
cannot see makes that version unportable and the fetch goes on; a failed
create leaves no folder behind. At most 32 reviews are open and 1,024 are
recorded (`review_limit_reached`).
- Removing a review host closes its reviews, cancels every review start in
flight (a start holds the token in memory), and reports, in the CLI and the
desktop, each review whose folder was left (`review_removal_incomplete`);
replacing a token cancels the starts too. Closing the application cancels
starts and reports one that stays as `review_starts_still_running`. The
review header reads the title, author, and state of an open review from
`review.json`, once its digest matches the one `review.started` recorded.
A review session refuses `workspace_git_read` (`git_read_disabled`).
`omgcode-platform` gains `CreateError::is_name_conflict`.
- Not done in this increment: the other four adapters (increment 4b), the
**Drafts** tab, and posting (increment 5). A pull request or file-list
answer that does not match the documented shape ends the start with
`review_host_response_invalid`.
- Fixed after a review of this increment, each with a test (ADR-0144):
- The review header says "Partial: N of M changed files" and "Incomplete: K
changed files without stored content" with the counts by outcome, as the
contract says, and no longer shows an error while the journal is busy: the
header and the **PR context** tab show the loading line and ask again every
second, at most 30 times.
- A start whose progress read answers `busy` after the fetch finished no
longer ends the dialog's wait and re-enables **Start review**, which could
fetch the same review twice. The dialog asks again, and after 30 busy
answers in a row says that the review may have been created.
- The PR context fences the description: each line starts with `| ` and 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 the largest record of a file before it downloads the file, drops
the notes of a record that no longer fits, and ends the list, marked
partial, when even that does not fit. About 900 changed links with
250-byte paths could fail the whole fetch after the downloads. `review.json`
is written compactly.
- Registering a workspace or granting a folder fails closed when the review
folder root cannot be found, and, while the first review has not created
the root yet, refuses a directory that holds the folder it will be created
in.
- `review_fetch_file`: one call at a time changes a review's ledger
(`<id>.ledger.lock`; a second call is refused with `review_busy` and sends
nothing), so its 500-call and 64 MiB budgets cannot be overrun. A file
stored before a failed ledger save is counted by the retry when its bytes
are the host's, instead of `review_unavailable` for good, and a failed save
removes its temporary file. Removing a review removes its ledger, temporary
file, and lock, and stays incomplete while one is left; a start sweeps
them for a closed review whose folder is gone.
- A review folder counts as deleted only when nothing is at its place, not
when the deletion fails with a not-found error that can name an entry inside
it.
- A path that the review text shows as an escape can no longer be stored:
`ReviewPath` also refuses U+061C, U+200E, U+200F, and U+FEFF, and a test
keeps the two character sets equal, so the path in the context is the path a
draft names.
- A request may have 48 path segments (it was 32), so the contents request
for a path of 30 components (34 segments) is no longer refused.
- A draft body with a bidirectional embedding, override, or isolate is
refused, and a carriage return and line feed pair is accepted as a line
feed.
- The review starts in flight end once a host's removal or a token's
replacement is recorded, or may be (an uncertain journal write), and never
for a change that core refuses, however late (a stale revision, an unknown
host, settings that changed during the dialog or while the call waited for
the store). The shared removal tells the desktop's `ReviewTurns`
(`host_unbound`); the cancel is still cooperative, and the contract says
what a start that passed its last check does.
- **Remove review…** takes the settings-change flag after its confirmation,
for the closing record only; held across the dialog it made a start that had
finished downloading fail with `settings_change_running`.
- Two different versions of more than 50,000 lines are not compared (the diff
outcome is `too_large`, and both versions are stored): in a debug build the
comparison took 1.2 to 3.3 seconds at 40,000 lines and over a minute on 1 MiB
of lines drawn from a few values, and cannot be cancelled. Release timings
were not measured.
- `pr/` keeps 1 MiB free of its 128 MiB 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; and the contract says that the PR context is recorded when the
review starts and that four adapters (for six kinds) remain.
- A start also deletes the folder of a closed review once it is a day old and
still the recorded one. A start that failed before it had a session, and
could not delete its folder, left a closed review that no session could
retry, and the sweep skipped it because a record named it.
- A test pins that a rename, a delete, and an edit of a fetched file in
`pr/` are refused (the source of a rename was already checked).
- The trusted CLI's `review-host remove` closes the host's reviews but
deletes no folder, because it cannot see a turn in the desktop application;
every review is reported as `review_removal_incomplete` and removing it in
the desktop finishes it.
- Fixed after a second review of this increment, each with a test:
- The review header drops the pull request's title the moment an open
review is shown as closed; a failed read of the closed review kept the
old title.
- A request with too many path segments is refused with a message that
says 48, not 32.
- The contract says that `review-host set-token` closes no review.
- A host removal that closes several reviews judges the turns of each on
its own (`ReviewTurns::stop` returns the reviews whose turns ended):
one turn that does not end within 60 seconds left every review's folder
in place, against the contract that one review that cannot be finished
does not stop the others.
- The documents no longer say that a removal or a replacement ends a
review start or revokes the old token: the start is asked to stop, a
request already sent completes with the token it loaded, and the old
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.
- The contract says that a start writes nothing into the review folder
after its review is recorded, so a removal that deletes the folder then
meets no writer.
- The contract says that a cancel is looked at for the last time just
before the review is recorded and ends no start after it (a test cancels
from inside the session's preparation), that a start that fails deletes
the folder it created by name without the record check, and that a
summary read begun just before a closing may return once more.
- Pinned by a test, as the second review questioned them and they were
right: a path of control characters counts at its escaped size in the
room budget, and a second distinct file replaces the ledger that the first
wrote.
- Questioned by the third review and found to be as designed. A new test
pins that a start writes nothing into the review folder after the review
is recorded: a folder that a removal deleted stays gone, and one that it
could not delete (on Windows the start's own handle keeps it open) is
left as the removal found it. An existing test
already pins that a directory that holds the folder a first review will
create the root in, or any ancestor of it, is refused while a sibling is
allowed.
- Version 0.91.0 implements increment 3 of the pull request review contract,
review hosts (ADR-0143).
- The operator can record a review host: a name, one of eight kinds
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "3"
members = ["crates/omgcode-core", "crates/omgcode-cli", "crates/omgcode-platform", "crates/omgcode-app", "crates/omgcode-desktop"]

[workspace.package]
version = "0.91.0"
version = "0.92.0"
edition = "2024"
rust-version = "1.99.1"
license = "Apache-2.0"
Expand Down
11 changes: 6 additions & 5 deletions crates/omgcode-app/src/chat/skills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ pub(super) fn load_selected(
// The journal's UUID only selects a registration; the ID used afterwards
// comes from current settings.
let workspace_id = control
.registered_workspace(journal.snapshot().workspace_id)
.map(|workspace| workspace.id())
.session_scope_id(journal.snapshot().workspace_id)
.ok_or_else(|| unavailable(&names[0]))?;
let mut skills = Vec::with_capacity(names.len());
let mut body_bytes = 0_usize;
Expand Down Expand Up @@ -137,8 +136,10 @@ fn load_bound(
let control = ControlStore::open_existing_waiting(data_root)
.map_err(|error| AppError::skill("control", error.to_string()))?
.ok_or_else(|| bound_withdrawn(binding))?;
// The session's workspace is a review that is still open. A closed
// review withdraws the skill with it.
if control
.registered_workspace(journal.snapshot().workspace_id)
.session_scope_id(journal.snapshot().workspace_id)
.is_none()
{
return Err(bound_withdrawn(binding));
Expand Down Expand Up @@ -191,8 +192,8 @@ pub(super) fn recheck(
.flatten()
.is_some_and(|control| {
control
.registered_workspace(journal.snapshot().workspace_id)
.is_some_and(|workspace| control.skill_selection_current(workspace.id(), skills))
.session_scope_id(journal.snapshot().workspace_id)
.is_some_and(|workspace| control.skill_selection_current(workspace, skills))
});
if current {
Ok(())
Expand Down
Loading