gitea-saas-core#30: isolated synthetic-merge review workspace #37

Merged
pbwraith merged 2 commits from issue-30 into main 2026-08-30 08:08:41 +02:00

2 Commits

Author SHA1 Message Date
Claude
069a74a95c fix(#30): shell-quote workspace paths + sanitize temp prefix (bounce-fix)
The review gate builds the synthetic merge in a temporary worktree whose
path was interpolated raw into Runner(shell=True) commands: paths with
spaces or shell metacharacters were split by the shell, so git's worktree
admin entry could survive cleanup (criterion 7 violation; CWD was also
misleading on failure).

- shlex.quote the worktree path in 'git worktree add --detach' and
  'git worktree remove --force'; SHA validation is unchanged.
- sanitize the mkdtemp prefix token ('owner/name' -> 'owner-name'), so a
  repo name with separators/punctuation cannot make mkdtemp fail.
- hermetic real-git tests: temp root containing a space and '$'
  constructs and cleans up completely (dir gone + absent from 'git
  worktree list --porcelain'); repo token with separators builds a
  single-component prefix and cleans up.
2026-08-29 18:10:40 -05:00
Claude
d8faabf2e5 gitea-saas-core#30: isolated synthetic-merge review workspace
Review gate: replaces the arbitrary repo_dir test target with a
review_workspace seam that builds a clean temporary git worktree from
the configured clone, fetches the exact base/head SHAs, and constructs
a real synthetic merge of the reviewed head onto the reviewed base.
Verdicts pin repo, PR, head SHA, and base SHA; tests + git diff --check
run inside the workspace with an explicit base..HEAD range; a merge
conflict yields a deterministic BOUNCE with conflicted-file evidence and
the suite is never run against a fallback checkout; no workspace
configured fails closed to NEEDS_GUIDANCE. Worktrees/refs are cleaned up
on success, conflict, timeout, and exceptions; the configured clone and
worker issue worktrees are never mutated.

Policy: before applying any verdict the PR is re-read and the verdict is
refused (outcome=stale/PAIR_MOVED, zero side effects) if the head OR
base moved after evaluation — the new pair stays eligible for a fresh
review. Client: normalized PR shape gains base_sha (REVIEW_CLONE_DIR is
the new config knob). Hermetic tests build local temp repos proving
clean merge, conflict, moved head/base, no shared-checkout mutation,
correct command cwd/range, and cleanup on failure (no network).
2026-08-29 15:21:43 -05:00