From patchwork Wed Dec 24 21:30:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1075 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766611884; bh=qRTS9JcvWNOB5fL44sIfVnVobxMDT7TTbHXU245M8rg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nA5P1MJ6RV1ThXILfw/+F9TmWDHHLWKh8yFaMd6/MJF82BymRfFNz/rVYyULmtPYx U00xHLBGQ8By+5wKzPDRxNLBlprS82ZdEspH26WYP2DIRG9j8725dfREXD2WElfpHO MQLQ6vU/xzydPfAQxxzq46/EIwHgu4XgibX6ci7tJ+0cnTXxOeqtpN/bSrZxzFIxEB JvKAvd7Nd9Tkl2XFx56tDgNo7VndiAssVOr4CvHvGT8/guuv48JTlsxjt90ynKG9Er FQEFOGHXdlI1JQ0ZdqTodBXWynEP6tPHDQXJJk+cbOglxhKjTIcQMWe2WcBdjezp3G z+zl/RlaLW0ag== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 07CE564E4A for ; Wed, 24 Dec 2025 14:31:24 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 3lXTzoNESBJB for ; Wed, 24 Dec 2025 14:31:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766611883; bh=qRTS9JcvWNOB5fL44sIfVnVobxMDT7TTbHXU245M8rg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bU/ZFoq6MgLtxwjkJ9ITCKhZ97r6P8a/QQn0PJtXJ63rMf9HTmcmzy27hJn6knktQ 5THN0TxJXTCcH8s9vLDAZNhfuFAI5RmdRaVoN80sYhx1zNf5YHaHbNSILbBRR910yW tXO4nGPp6IvbKyOzAzhnRoC0QmoTHnSkmNbX2RwIuB+SvulMZfxtLQQYjpZBYWk2WN QL3NYbfJ/6zJmIvQA04QSZbHolOtQMtpApckVPOzgFgHQI/HM5dY9fkd82gaxj/IFT AdFRa+ti0dMUlPYwEtCeKlNmu+z5w5fFVIyZGpPxadTJLfATwsoVWhm6RKQaBWPo0V Ou5MqjDPKFlLQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E1D2064DF6 for ; Wed, 24 Dec 2025 14:31:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766611881; bh=/1Nkbtn0NbdBrlXvW/Xzc6QGSPfsfSM5oKzTmwnju8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQxWsjnQFTtFIMX3Mzww+0pRdgRTZB720QIhUavRZlK/UD6BOKPtSDXzVdvy0ibHN 2nPd1b9Po5SNjd2skBMPGTQkO6SPnOCJdN+tJ8uXzM2SfVpjHhbx4zHAsbNt8W9eVw wpRf/i9HkjUKVtkp17Q6mmotKU+JXFD5Awkml7h/cPu9SoMzpq2iT76LM/HXpYPaJt PBN4MAvH0kHGwCP0Hgmhy4/WpZChTEXs55FJne+DI0v7kOsvz5uThbmwFroZDclFBl zd6qkzONwlTFuWLIwr02QWCfVVZs20PrXApCIn/nknQTOcZryVELkyzGQU4VaklNrm /1gj//9nIRo0g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9DCB364CA9; Wed, 24 Dec 2025 14:31:21 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Qe58skGeAGGT; Wed, 24 Dec 2025 14:31:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766611877; bh=sVf26+Us+ZREnOu3WWGjOqjGHWYMUyDfY3sfl8n/yhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wON8wUPeTsSUF5fQ8Pf21yPMCabrLTQb3txKHJ43vyr8A2/ciR3uqWpWsYdV9bqKO lgjfltZBG1xVvLlFn1qOnenlOhKi7XmSjNcDj3f+N6tLGYymxSmqbhpUwP7wgOEHn8 qubvMJd6mXjLC4fXcw1GyNpK1WPhPe4ZVDyvyv2jQMrVhX3XDO+DJouu1ck2kVMYxw vIRBHo4K4ZmBOpNHcStSl+8laQd61lp/6LeYlfDAo8J0bhKTjbAu+HGM+/JV8Rbjs9 NwUbWoWkHrk9g0BT/bkpqTaKtPT2/sfV1gJi3Ucyjtjc8QdKWz6t4hp0zgOwefAJ/N pAiWiBWII5Quw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2866664DD8; Wed, 24 Dec 2025 14:31:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 24 Dec 2025 14:30:36 -0700 Message-ID: <20251224213045.3010514-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251224213045.3010514-1-sjg@u-boot.org> References: <20251224213045.3010514-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CZ5VGJBANVBSA4LIAIACBOBKHIJUE7J7 X-Message-ID-Hash: CZ5VGJBANVBSA4LIAIACBOBKHIJUE7J7 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 5/9] pickman: Enhance agent prompts with per-commit validation List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add per-commit delta-checking and build-validation to the cherry-pick and review agents: - Check commit deltas after each cherry-pick to catch problems early - Run buildman after each commit instead of only at the end - Add recovery strategies for commits with large deltas - Include delta checking in rebase operations - Improve error handling and reporting Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/pickman/agent.py | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/tools/pickman/agent.py b/tools/pickman/agent.py index d2a9ba562f8..89014df0120 100644 --- a/tools/pickman/agent.py +++ b/tools/pickman/agent.py @@ -91,19 +91,35 @@ Steps to follow: Cherry-pick one commit at a time to handle each appropriately. IMPORTANT: Always include merge commits even if they result in empty commits. The merge commit message is important for tracking history. -4. If there are conflicts: +4. AFTER EACH SUCCESSFUL CHERRY-PICK: + a) Check commit delta: 'git show --stat ' and 'git show --stat ' + Compare the changed files and line counts. If they differ significantly (>20% lines changed + or different files modified), this indicates a problem with the cherry-pick. + b) Build test: Run 'buildman -L --board sandbox -w -o /tmp/pickman' to verify the build passes + c) If delta is too large: + - Reset the commit: 'git reset --hard HEAD~1' + - Try to manually apply just the changes from the original commit: + 'git show | git apply --3way' + - If that succeeds, create a new commit with the original message + - If fails, try to apply the patch manually. + - If manual apply fails, create an empty commit to preserve the commit sequence: + 'git commit --allow-empty -m " [FAILED]"' + - Continue to the next commit + d) If build fails and you cannot resolve it, report the issue and abort +5. If there are conflicts: - Show the conflicting files - Try to resolve simple conflicts automatically - For complex conflicts, describe what needs manual resolution and abort - When fix-ups are needed, amend the commit to add a one-line note at the end of the commit message describing the changes made -5. After ALL cherry-picks complete, verify with +6. After ALL cherry-picks complete, verify with 'git log --oneline -n {len(commits) + 2}' Ensure all {len(commits)} commits are present. -6. Run 'buildman -L --board sandbox -w -o /tmp/pickman' to verify the build -7. Report the final status including: +7. Run final build: 'buildman -L --board sandbox -w -o /tmp/pickman' to verify everything still works together +8. Report the final status including: - Build result (ok or list of warnings/errors) - Any fix-ups that were made + - Any commits with concerning deltas The cherry-pick branch will be left ready for pushing. Do NOT merge it back to any other branch. @@ -243,6 +259,10 @@ Rebase instructions: - The MR is behind the target branch and needs rebasing - Use: git rebase --keep-empty {remote}/{target} - This preserves empty merge commits which are important for tracking +- AFTER EACH REBASED COMMIT: Check delta and build + a) Compare commit delta before/after rebase using 'git show --stat' + b) Run 'buildman -L --board sandbox -w -o /tmp/pickman' to verify build passes + c) If delta is significantly different or build fails, report and abort - If there are conflicts, try to resolve them automatically - For complex conflicts that cannot be resolved, describe them and abort ''' @@ -297,7 +317,7 @@ Steps to follow: 2. {step2} 3. {step3} {comment_steps} -4. Run 'buildman -L --board sandbox -w -o /tmp/pickman' to verify the build +4. Run 'buildman -L --board sandbox -w -o /tmp/pickman' to verify the build passes 5. Create a local branch with suffix '-v2' (or increment: -v3, -v4, etc.) 6. Force push to the ORIGINAL remote branch to update the MR: ./tools/pickman/pickman push-branch {branch_name} -r {remote} -f