Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
152 changes: 138 additions & 14 deletions .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
review:
if: github.event.pull_request.user.login == 'Jordonbc'
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write
contents: read
pull-requests: write
issues: write

Expand All @@ -31,12 +31,74 @@ jobs:
model: ${{ vars.OPENCODE_REVIEW_MODEL }}
use_github_token: true
prompt: |
Before anything else, read and follow AGENTS.md for this repository and module.
Review this pull request:
- Check for code quality issues
- Look for potential bugs
- Suggest improvements
- If you make any code edits, run 'cd Client && just test' to verify they compile and pass tests before committing.
Before doing anything else, read and follow AGENTS.md for this repository and for any affected module.

You are reviewing this pull request only. Do not edit files, do not commit changes, and do not attempt to rewrite the PR.

Review only the changes introduced by this pull request, using surrounding repository context only when needed to understand correctness.

Focus on:
- Correctness bugs
- Regressions
- Unsafe assumptions
- Error handling problems
- API misuse
- Race conditions, lifetime issues, ownership issues, or resource leaks
- Test coverage gaps where the changed behaviour is not adequately covered
- Maintainability issues that would realistically matter in this codebase

Do not comment on:
- Pure style preferences unless AGENTS.md or existing repository conventions clearly require them
- Hypothetical rewrites
- Broad architecture advice unrelated to this PR
- Trivial naming or formatting issues unless they obscure correctness
- Missing tests for code that has no meaningful behavioural change

For every finding:
- Cite the specific file and changed line/range when possible
- Explain why it is a real issue
- Explain the likely impact
- Suggest the smallest reasonable fix
- State confidence as High, Medium, or Low

Use this severity scale:
- Blocking: correctness, data loss, security, build failure, test failure, serious regression
- Important: likely bug, maintainability risk, missing validation, meaningful test gap, or unproven cross-layer behaviour
- Minor: small cleanup with clear value

Prefer fewer, higher-confidence comments over many speculative comments.

Pay special attention to semantic mismatches:
- Comments that do not match the code behaviour
- Variable names that imply different behaviour than the implementation
- Function names that imply different behaviour than the implementation
- Frontend/backend/plugin contract mismatches
- Changed values passed across process, IPC, API, or plugin boundaries
- Sentinel values such as 0, -1, null, undefined, empty strings, and empty arrays
- Type-safe code that may still be behaviourally wrong

When reviewing sentinel values:
- Do not assume 0 means "unlimited", "default", "disabled", or "empty" unless the implementation explicitly proves it
- Do not assume null, undefined, empty strings, or empty arrays preserve existing/default behaviour unless the implementation explicitly proves it
- Trace the changed value through every visible layer before deciding it is safe
- If a changed value crosses frontend/backend/plugin boundaries and its final meaning is not explicitly proven, flag it as an Important finding
- If behaviour depends on a downstream plugin, backend, external command, or runtime convention that is not visible in the PR, flag the assumption instead of treating it as safe
- Treat contradictions between comments and runtime behaviour as review-worthy

Treat contradictory intent as a real bug:
- If a comment, variable name, function name, or PR intent says the code should do one thing, but the implementation appears to do another, flag it as an Important finding
- Do not rationalise contradictions as intentional unless the implementation explicitly proves that interpretation
- Do not describe contradictory behaviour as correct
- Example: if code claims to load "full history" but passes `limit: 0`, and the visible backend preserves `0` as `0`, you must flag that as a potential bug unless another visible layer explicitly maps `0` to unlimited

Before concluding that there are no substantive issues:
- Re-check any finding where the code behaviour appears to contradict a comment, variable name, function name, or stated intent
- Re-check every changed sentinel value that crosses a frontend/backend/plugin boundary
- Do not treat "the code compiles" as evidence that behaviour is correct
- Do not infer intended behaviour from comments alone
- If you are relying on an assumption about downstream behaviour, say so explicitly and treat it as a review concern

If there are no substantive issues, say that no blocking or important issues were found. Do not invent issues to appear useful.

- name: fallback
if: ${{ steps.review_primary.outcome == 'failure' }}
Expand All @@ -49,9 +111,71 @@ jobs:
model: ${{ vars.OPENCODE_REVIEW_MODEL_FALLBACK }}
use_github_token: true
prompt: |
Before anything else, read and follow AGENTS.md for this repository and module.
Review this pull request:
- Check for code quality issues
- Look for potential bugs
- Suggest improvements
- If you make any code edits, run 'cd Client && just test' to verify they compile and pass tests before committing.
Before doing anything else, read and follow AGENTS.md for this repository and for any affected module.

You are reviewing this pull request only. Do not edit files, do not commit changes, and do not attempt to rewrite the PR.

Review only the changes introduced by this pull request, using surrounding repository context only when needed to understand correctness.

Focus on:
- Correctness bugs
- Regressions
- Unsafe assumptions
- Error handling problems
- API misuse
- Race conditions, lifetime issues, ownership issues, or resource leaks
- Test coverage gaps where the changed behaviour is not adequately covered
- Maintainability issues that would realistically matter in this codebase

Do not comment on:
- Pure style preferences unless AGENTS.md or existing repository conventions clearly require them
- Hypothetical rewrites
- Broad architecture advice unrelated to this PR
- Trivial naming or formatting issues unless they obscure correctness
- Missing tests for code that has no meaningful behavioural change

For every finding:
- Cite the specific file and changed line/range when possible
- Explain why it is a real issue
- Explain the likely impact
- Suggest the smallest reasonable fix
- State confidence as High, Medium, or Low

Use this severity scale:
- Blocking: correctness, data loss, security, build failure, test failure, serious regression
- Important: likely bug, maintainability risk, missing validation, meaningful test gap, or unproven cross-layer behaviour
- Minor: small cleanup with clear value

Prefer fewer, higher-confidence comments over many speculative comments.

Pay special attention to semantic mismatches:
- Comments that do not match the code behaviour
- Variable names that imply different behaviour than the implementation
- Function names that imply different behaviour than the implementation
- Frontend/backend/plugin contract mismatches
- Changed values passed across process, IPC, API, or plugin boundaries
- Sentinel values such as 0, -1, null, undefined, empty strings, and empty arrays
- Type-safe code that may still be behaviourally wrong

When reviewing sentinel values:
- Do not assume 0 means "unlimited", "default", "disabled", or "empty" unless the implementation explicitly proves it
- Do not assume null, undefined, empty strings, or empty arrays preserve existing/default behaviour unless the implementation explicitly proves it
- Trace the changed value through every visible layer before deciding it is safe
- If a changed value crosses frontend/backend/plugin boundaries and its final meaning is not explicitly proven, flag it as an Important finding
- If behaviour depends on a downstream plugin, backend, external command, or runtime convention that is not visible in the PR, flag the assumption instead of treating it as safe
- Treat contradictions between comments and runtime behaviour as review-worthy

Treat contradictory intent as a real bug:
- If a comment, variable name, function name, or PR intent says the code should do one thing, but the implementation appears to do another, flag it as an Important finding
- Do not rationalise contradictions as intentional unless the implementation explicitly proves that interpretation
- Do not describe contradictory behaviour as correct
- Example: if code claims to load "full history" but passes `limit: 0`, and the visible backend preserves `0` as `0`, you must flag that as a potential bug unless another visible layer explicitly maps `0` to unlimited

Before concluding that there are no substantive issues:
- Re-check any finding where the code behaviour appears to contradict a comment, variable name, function name, or stated intent
- Re-check every changed sentinel value that crosses a frontend/backend/plugin boundary
- Do not treat "the code compiles" as evidence that behaviour is correct
- Do not infer intended behaviour from comments alone
- If you are relying on an assumption about downstream behaviour, say so explicitly and treat it as a review concern

If there are no substantive issues, say that no blocking or important issues were found. Do not invent issues to appear useful.
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Backend:
Feature-facing backend API lives under `Backend/src/tauri_commands/`.
- Backend/plugin boundary:
Backend communicates with plugin processes over JSON-RPC over stdio.
- Repo-open UI labels can be resolved from the active backend via backend-provided action-label maps; generic VCS text remains the fallback.
- Settings boundary:
Backend persists/loads app configuration and mediates environment application.

Expand Down
9 changes: 5 additions & 4 deletions Backend/src/core/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ pub struct LogQuery {
pub author_contains: Option<String>,
/// Number of commits to skip.
pub skip: u32,
/// Maximum number of commits to return.
pub limit: u32,
/// Maximum number of commits to return, or `None` for unlimited.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u32>,
/// Sort in topological order.
pub topo_order: bool,
/// Include merge commits.
Expand All @@ -149,7 +150,7 @@ impl LogQuery {
/// Creates a query for the HEAD commit with the given limit.
pub fn head(limit: u32) -> Self {
Self {
limit,
limit: Some(limit),
..Default::default()
}
}
Expand Down Expand Up @@ -216,7 +217,7 @@ mod tests {
/// Verifies `LogQuery::head` sets only the limit field.
fn log_query_head_sets_limit_and_defaults_rest() {
let query = LogQuery::head(25);
assert_eq!(query.limit, 25);
assert_eq!(query.limit, Some(25));
assert!(query.rev.is_none());
assert!(query.path.is_none());
assert_eq!(query.skip, 0);
Expand Down
79 changes: 40 additions & 39 deletions Backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,56 +316,57 @@ fn build_invoke_handler<R: tauri::Runtime>(
tauri_commands::list_vcs_backends_cmd,
tauri_commands::set_vcs_backend_cmd,
tauri_commands::reopen_current_repo_cmd,
tauri_commands::validate_git_url,
tauri_commands::validate_vcs_url,
tauri_commands::validate_add_path,
tauri_commands::validate_clone_input,
tauri_commands::current_repo_path,
tauri_commands::list_recent_repos,
tauri_commands::git_list_branches,
tauri_commands::git_status,
tauri_commands::git_log,
tauri_commands::git_stash_list,
tauri_commands::git_stash_push,
tauri_commands::git_stash_apply,
tauri_commands::git_stash_pop,
tauri_commands::git_stash_drop,
tauri_commands::git_stash_show,
tauri_commands::git_head_status,
tauri_commands::git_checkout_branch,
tauri_commands::git_create_branch,
tauri_commands::git_rename_branch,
tauri_commands::git_current_branch,
tauri_commands::vcs_list_branches,
tauri_commands::current_vcs_action_labels,
tauri_commands::vcs_status,
tauri_commands::vcs_log,
tauri_commands::vcs_stash_list,
tauri_commands::vcs_stash_push,
tauri_commands::vcs_stash_apply,
tauri_commands::vcs_stash_pop,
tauri_commands::vcs_stash_drop,
tauri_commands::vcs_stash_show,
tauri_commands::vcs_head_status,
tauri_commands::vcs_checkout_branch,
tauri_commands::vcs_create_branch,
tauri_commands::vcs_rename_branch,
tauri_commands::vcs_current_branch,
tauri_commands::get_repo_summary,
tauri_commands::open_repo,
tauri_commands::clone_repo,
tauri_commands::git_diff_file,
tauri_commands::git_conflict_details,
tauri_commands::git_resolve_conflict_side,
tauri_commands::git_save_merge_result,
tauri_commands::git_launch_merge_tool,
tauri_commands::git_delete_branch,
tauri_commands::git_merge_branch,
tauri_commands::git_merge_context,
tauri_commands::git_merge_abort,
tauri_commands::git_merge_continue,
tauri_commands::git_set_upstream,
tauri_commands::git_diff_commit,
tauri_commands::git_cherry_pick_to_branch,
tauri_commands::git_revert_commit,
tauri_commands::vcs_diff_file,
tauri_commands::vcs_conflict_details,
tauri_commands::vcs_resolve_conflict_side,
tauri_commands::vcs_save_merge_result,
tauri_commands::vcs_launch_merge_tool,
tauri_commands::vcs_delete_branch,
tauri_commands::vcs_merge_branch,
tauri_commands::vcs_merge_context,
tauri_commands::vcs_merge_abort,
tauri_commands::vcs_merge_continue,
tauri_commands::vcs_set_upstream,
tauri_commands::vcs_diff_commit,
tauri_commands::vcs_cherry_pick_to_branch,
tauri_commands::vcs_revert_commit,
tauri_commands::commit_changes,
tauri_commands::commit_selected,
tauri_commands::commit_patch,
tauri_commands::commit_patch_and_files,
tauri_commands::git_discard_paths,
tauri_commands::git_discard_patch,
tauri_commands::git_set_remote_url,
tauri_commands::git_fetch,
tauri_commands::git_fetch_all,
tauri_commands::git_pull,
tauri_commands::git_push,
tauri_commands::git_undo_since_push,
tauri_commands::git_undo_to_commit,
tauri_commands::git_add_to_gitignore_paths,
tauri_commands::vcs_discard_paths,
tauri_commands::vcs_discard_patch,
tauri_commands::vcs_set_remote_url,
tauri_commands::vcs_fetch,
tauri_commands::vcs_fetch_all,
tauri_commands::vcs_pull,
tauri_commands::vcs_push,
tauri_commands::vcs_undo_since_push,
tauri_commands::vcs_undo_to_commit,
tauri_commands::vcs_add_to_gitignore_paths,
tauri_commands::open_repo_file,
tauri_commands::read_repo_file_text,
tauri_commands::list_themes,
Expand Down
Loading
Loading