Skip to content

Commit b8cff4f

Browse files
chernistryclaude
andcommitted
style: auto-format 43 files missed by refactoring agents
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4c86295 commit b8cff4f

44 files changed

Lines changed: 562 additions & 331 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/bernstein/cli/commands/audit_cmd.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ def _verify_hmac_chain() -> bool:
170170
Panel("[bold green]HMAC Chain Verification Passed[/bold green]", border_style="green", expand=False)
171171
)
172172
return True
173-
console.print(
174-
Panel("[bold red]HMAC Chain Verification FAILED[/bold red]", border_style="red", expand=False)
175-
)
173+
console.print(Panel("[bold red]HMAC Chain Verification FAILED[/bold red]", border_style="red", expand=False))
176174
for err in hmac_errors:
177175
console.print(f" [red]![/red] {err}")
178176
return False
@@ -186,9 +184,7 @@ def _verify_merkle_tree() -> bool:
186184

187185
console.print()
188186
if result.valid:
189-
console.print(
190-
Panel("[bold green]Merkle Verification Passed[/bold green]", border_style="green", expand=False)
191-
)
187+
console.print(Panel("[bold green]Merkle Verification Passed[/bold green]", border_style="green", expand=False))
192188
table = Table(show_header=False, box=None, padding=(0, 2))
193189
table.add_column("Key", style="dim", no_wrap=True, min_width=14)
194190
table.add_column("Value")
@@ -197,9 +193,7 @@ def _verify_merkle_tree() -> bool:
197193
table.add_row("Seal file", str(result.seal_path))
198194
console.print(table)
199195
return True
200-
console.print(
201-
Panel("[bold red]Merkle Verification FAILED[/bold red]", border_style="red", expand=False)
202-
)
196+
console.print(Panel("[bold red]Merkle Verification FAILED[/bold red]", border_style="red", expand=False))
203197
for err in result.errors:
204198
console.print(f" [red]![/red] {err}")
205199
return False

src/bernstein/cli/commands/cost.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,20 @@ def cost_cmd(metrics_dir: str, last: str | None, group_by: str | None, as_json:
646646

647647
if as_json or is_json():
648648
_cost_render_json(
649-
time_label, sorted_models, totals, fast_path_savings, savings_vs_opus,
650-
savings_vs_manual, daily_costs, projected_monthly, tasks_done, tasks_failed,
651-
cache_hit_rate, grouped_data, group_by, downgrade,
649+
time_label,
650+
sorted_models,
651+
totals,
652+
fast_path_savings,
653+
savings_vs_opus,
654+
savings_vs_manual,
655+
daily_costs,
656+
projected_monthly,
657+
tasks_done,
658+
tasks_failed,
659+
cache_hit_rate,
660+
grouped_data,
661+
group_by,
662+
downgrade,
652663
)
653664
return
654665

src/bernstein/cli/commands/delegate_cmd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ def delegate(
155155

156156

157157
def _report_terminal_status(
158-
task_id: str, status: str, result_summary: str, poll_url: str, as_json: bool,
158+
task_id: str,
159+
status: str,
160+
result_summary: str,
161+
poll_url: str,
162+
as_json: bool,
159163
) -> None:
160164
"""Report a terminal task status and exit if failed."""
161165
if as_json:

src/bernstein/cli/commands/diff_cmd.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ def _get_stat_from_branch(branch: str, workdir: Path, base: str = "main") -> str
197197

198198

199199
def _try_worktree_diff(
200-
session_id: str, root: Path, base: str,
200+
session_id: str,
201+
root: Path,
202+
base: str,
201203
) -> tuple[str, str, str, list[FileDiffStat]]:
202204
"""Try to get diff from a live worktree. Returns (diff, label, stat, file_stats)."""
203205
worktree_path = root / ".sdd" / "worktrees" / session_id
@@ -214,7 +216,9 @@ def _try_worktree_diff(
214216

215217

216218
def _try_branch_diff(
217-
session_id: str, root: Path, base: str,
219+
session_id: str,
220+
root: Path,
221+
base: str,
218222
) -> tuple[str, str, str, list[FileDiffStat]]:
219223
"""Try to get diff from a local branch. Returns (diff, label, stat, file_stats)."""
220224
branch = f"agent/{session_id}"
@@ -230,7 +234,8 @@ def _try_branch_diff(
230234

231235

232236
def _try_merge_commit_diff(
233-
session_id: str, root: Path,
237+
session_id: str,
238+
root: Path,
234239
) -> tuple[str, str, str, list[FileDiffStat]]:
235240
"""Try to get diff from a merge commit. Returns (diff, label, stat, file_stats)."""
236241
merge_commit = _find_merge_commit(session_id, root)

src/bernstein/cli/commands/dry_run_cmd.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,14 @@ def _render_dry_run_from_backlog(workdir: Path) -> list[dict[str, Any]]:
131131
)
132132
result.append(
133133
_route_task_to_dict(
134-
router, bt.source_file, bt.title, bt.role, bt.priority, bt.scope, bt.complexity, t_obj,
134+
router,
135+
bt.source_file,
136+
bt.title,
137+
bt.role,
138+
bt.priority,
139+
bt.scope,
140+
bt.complexity,
141+
t_obj,
135142
)
136143
)
137144
return result

src/bernstein/cli/commands/evolve_cmd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ def evolve() -> None:
9797
help="GitHub repo slug (owner/repo). Inferred from git remote if omitted.",
9898
)
9999
def _load_evolve_config_from_seed(
100-
root: Path, github_sync: bool, github_repo: str | None,
100+
root: Path,
101+
github_sync: bool,
102+
github_repo: str | None,
101103
) -> tuple[bool, str | None]:
102104
"""Read evolve config from bernstein.yaml if CLI flags were not set."""
103105
for seed_name in ("bernstein.yaml", "bernstein.yml"):

src/bernstein/cli/commands/status_cmd.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,18 @@ def _collect_pid_agents(pid_path: Path) -> tuple[list[dict[str, Any]], list[Path
222222
hours, minutes = divmod(minutes, 60)
223223
runtime_str = f"{hours}h {minutes:02d}m" if hours else f"{minutes}m {secs:02d}s"
224224

225-
agents.append({
226-
"session": info.get("session", "?"),
227-
"role": info.get("role", "?"),
228-
"command": info.get("command", "?"),
229-
"model": info.get("model", "?"),
230-
"worker_pid": worker_pid,
231-
"child_pid": info.get("child_pid"),
232-
"runtime": runtime_str,
233-
"started_at": started_at,
234-
})
225+
agents.append(
226+
{
227+
"session": info.get("session", "?"),
228+
"role": info.get("role", "?"),
229+
"command": info.get("command", "?"),
230+
"model": info.get("model", "?"),
231+
"worker_pid": worker_pid,
232+
"child_pid": info.get("child_pid"),
233+
"runtime": runtime_str,
234+
"started_at": started_at,
235+
}
236+
)
235237

236238
return agents, stale_files
237239

src/bernstein/cli/commands/undo_cmd.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def _find_commits_to_revert(task_id: str | None, revert_all: bool) -> list[tuple
5757
try:
5858
res = subprocess.run(
5959
["git", "log", "-n", "50", "--pretty=format:%H %s"],
60-
capture_output=True, text=True, encoding="utf-8", errors="replace", cwd=".",
60+
capture_output=True,
61+
text=True,
62+
encoding="utf-8",
63+
errors="replace",
64+
cwd=".",
6165
)
6266
commits: list[tuple[str, str]] = []
6367
for line in res.stdout.splitlines():
@@ -98,8 +102,10 @@ def _log_undo_audit(task_id: str | None, revert_all: bool, success_count: int) -
98102
resource_type="session",
99103
resource_id=task_id or "all",
100104
details={
101-
"action": "revert", "commit_count": success_count,
102-
"task_id": task_id, "revert_all": revert_all,
105+
"action": "revert",
106+
"commit_count": success_count,
107+
"task_id": task_id,
108+
"revert_all": revert_all,
103109
},
104110
)
105111
except Exception:

src/bernstein/cli/commands/wrap_up_cmd.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,13 @@ def wrap_up(do_stop: bool, timeout: int) -> None:
264264

265265
# 8. Print Rich-formatted wrap-up
266266
_render_wrapup_brief(
267-
workdir, saved_path, start_sha, done_tasks, learnings,
268-
git_diff_stat, next_session_brief,
267+
workdir,
268+
saved_path,
269+
start_sha,
270+
done_tasks,
271+
learnings,
272+
git_diff_stat,
273+
next_session_brief,
269274
)
270275

271276
# 9. Optionally soft-stop

src/bernstein/cli/commit_stats.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def _author_to_role(author: str) -> str:
9494
_GIT_NUMSTAT_FMT = "%aN%n" # author name then numstat block
9595

9696

97-
def _parse_numstat_line(
98-
line: str, current_author: str | None
99-
) -> tuple[str | None, tuple[str, int, int] | None]:
97+
def _parse_numstat_line(line: str, current_author: str | None) -> tuple[str | None, tuple[str, int, int] | None]:
10098
"""Parse a single line from git log --numstat output.
10199
102100
Returns:
@@ -193,9 +191,7 @@ def _count_commits_by_role(
193191
if until:
194192
author_cmd.extend(["--until", until])
195193
try:
196-
author_result = subprocess.run(
197-
author_cmd, capture_output=True, text=True, encoding="utf-8", errors="replace"
198-
)
194+
author_result = subprocess.run(author_cmd, capture_output=True, text=True, encoding="utf-8", errors="replace")
199195
if author_result.returncode == 0:
200196
for line in author_result.stdout.splitlines():
201197
line = line.strip()

0 commit comments

Comments
 (0)