commit c05152b062d03bc89f211f476b00aebcdd9b6d00
parent b8491ac11f96ce6c64fd1a0f448899f846076ea6
Author: Brian Graham <brian@buildingbetterteams.de>
Date: Sat, 4 Apr 2026 10:45:16 +0200
Auto-commit and push results after sweep completes
When a sweep finishes with new completed runs, the harness
automatically stages results/ and dashboard/public/artifacts/,
commits with a summary message, and pushes to origin.
Falls back gracefully if push fails (results still committed locally).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 32 insertions(+), 0 deletions(-)
diff --git a/harness/run.py b/harness/run.py
@@ -732,6 +732,38 @@ def main():
print(f"Completed: {completed} | Skipped: {skipped} | Failed: {failed}")
print("=" * 40)
+ # Auto-commit and push results
+ if completed > 0:
+ print()
+ print("Committing results...")
+ try:
+ subprocess.run(
+ ["git", "add", "results/", "dashboard/public/artifacts/"],
+ cwd=str(PROJECT_DIR), capture_output=True,
+ )
+ total_runs = len(list((results_dir / "runs").iterdir()))
+ msg = (
+ f"Add {completed} new runs ({total_runs} total)\n\n"
+ f"Profile: {profile}\n"
+ f"Completed: {completed} | Skipped: {skipped} | Failed: {failed}"
+ )
+ subprocess.run(
+ ["git", "commit", "-m", msg],
+ cwd=str(PROJECT_DIR), capture_output=True,
+ )
+ result = subprocess.run(
+ ["git", "push"],
+ cwd=str(PROJECT_DIR), capture_output=True, text=True,
+ )
+ if result.returncode == 0:
+ print("Results committed and pushed.")
+ else:
+ print(f"Push failed: {result.stderr.strip()}")
+ print("Results committed locally. Push manually with: git push")
+ except Exception as e:
+ print(f"Auto-commit failed: {e}")
+ print("Commit manually with: git add results/ dashboard/public/artifacts/ && git commit && git push")
+
if __name__ == "__main__":
main()