From a38cb5c317a422bca6db15f1b3eafa1c10796e2c Mon Sep 17 00:00:00 2001 From: CleverThis Date: Sun, 31 May 2026 10:17:42 -0400 Subject: [PATCH] fix(uat-tester): remove one-shot script and batch examples.json update - Delete scripts/fix_uat_tester.py: one-off patch script with a hardcoded /tmp path that no longer exists. Per CONTRIBUTING.md, scripts/ is for ongoing-purpose utilities, not development artifacts. - Remove update_examples_json() from create_documentation_pr(): each per-PR call was modifying examples.json inside the git clone, causing merge conflicts when parallel UAT workers created docs PRs simultaneously. Option A from reviewer: move the call outside the PR creation function entirely. - Add batch update_examples_json(documented_examples) call after the inner docs-PR creation loop completes, guarded by `if documented_examples`. This runs once per cycle instead of once per PR, eliminating the examples.json conflict surface for parallel workers. - Expand CHANGELOG entry to reflect the examples.json fix. ISSUES CLOSED: #4374 --- .opencode/agents/uat-tester.md | 9 ++++++--- CHANGELOG.md | 6 ++++-- scripts/fix_uat_tester.py | 26 -------------------------- 3 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 scripts/fix_uat_tester.py diff --git a/.opencode/agents/uat-tester.md b/.opencode/agents/uat-tester.md index 04b320ce2..ca640f5fa 100644 --- a/.opencode/agents/uat-tester.md +++ b/.opencode/agents/uat-tester.md @@ -677,6 +677,12 @@ LOOP: documented_examples.append(example_candidate) update_examples_index(example_candidate) + # Batch-update examples.json once after all docs PRs for this cycle are + # created. Keeping this outside create_documentation_pr() avoids + # per-PR merge conflicts when parallel UAT workers run simultaneously. + if documented_examples: + update_examples_json(documented_examples) + tested_features.add(feature) # ── After testing all features in area — exit ──────────────── @@ -876,9 +882,6 @@ def create_documentation_pr(doc_path, doc_content, example): mkdir -p $(dirname doc_path) write_file(doc_path, doc_content) - # Update examples.json index - update_examples_json(example) - # Commit changes git add . commit_msg = f"docs: add {example['category']} example - {example['feature']}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 65672b37f..d6ce8852a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -481,11 +481,13 @@ _ALL_DATA_COLUMNS + ") " "SELECT " + _ALL_DATA_COLUMNS + " FROM v3_plans"`. ### Fixed -- **UAT tester docs PR duplicate detection** (#5768): Fixed two bugs in the +- **UAT tester docs PR duplicate detection and examples.json conflict fix** (#5768): Fixed two bugs in the `create_documentation_pr()` function of the uat-tester agent that caused documentation PRs to be skipped: branch-existence guard incorrectly treated error responses as success, and open-PR duplicate check missed owner prefix. - Resolves merge conflicts from parallel UAT worker documentation PRs. + Removed `update_examples_json()` from `create_documentation_pr()` and moved + it to a single batch call after all docs PRs are created per cycle, eliminating + merge conflicts on `examples.json` when parallel UAT workers run simultaneously. - **`invariant_enforced` decisions not propagated to child plans on subplan spawn** (#9131): Fixed `SubplanService.spawn()` to propagate all `invariant_enforced` decisions from the diff --git a/scripts/fix_uat_tester.py b/scripts/fix_uat_tester.py deleted file mode 100644 index 44272ed82..000000000 --- a/scripts/fix_uat_tester.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python3 -"""Patch script to fix uat-tester documentation PR duplicate bugs.""" - -FILE_PATH = ( - "/tmp/implementation-worker-1776852370/repo/.opencode/agents/uat-tester.md" -) -with open(FILE_PATH) as f: - content = f.read() - -# Fix branch-existence guard bug -content = content.replace( - "existing_branch.get('error')", - "existing_branch.get('errors')", -) - -# Fix open-PR check — add owner prefix to head param (long URL, noqa E501) -content = content.replace( - 'f"/repos/{owner}/{repo}/pulls?state=open&head={branch_name}"' - "&limit=5\"", - 'f"/repos/{owner}/{repo}/pulls?state=open&head={owner}:{branch_name}"' - "&limit=5\"", -) - -with open(FILE_PATH, "w") as f: - f.write(content) -print("Fixed both bugs")